SlideShare a Scribd company logo
1 of 60
Download to read offline
Agile AJAX:
  The Google Web Toolkit
       Experience

Paul Infield-Harm                                  Daniel Wellman
 paul@infield-harm.org                             dan@danielwellman.com
 www.infield-harm.org                               blog.danielwellman.com


                        www.cyrusinnovation.com
                         New York • Boston
What is
Google Web Toolkit ?
Java
Java to JavaScript
           compiler

.java                   .js     .js
  .java
   .java     Compiler
    .java
     .java
                        .js     .js


Java                    JavaScript
Why?
“...because there already are so many
great tools out there, not to mention
       scads of books, articles,
    libraries, and expertise.”
                        - The GWT Team
Demo
A Taste of GWT

• Application, Java source, generated js
• Exploratory dev in hosted mode
• Making a change, test-first
A Taste of GWT

• Application, Java source, generated js
• Exploratory dev in hosted mode
• Making a change, test-first
A Taste of GWT

• Application, Java source, generated js
• Exploratory dev in hosted mode
• Making a change, test-first
A Taste of GWT

• Application, Java source, generated js
• Exploratory dev in hosted mode
• Making a change, test-first
Application, Java
source, generated JS
Exploratory dev in
  hosted mode
Making a change, test-
        first
JSNI
                     photo by clothfairy
       http://www.flickr.com/photos/clothfairy/ CC BY 2.0
GWT and
Agile
Development
Practices
Agile Development
     Practices
  • Refactoring
  • Performance Optimization
  • Test-Driven Development
  • Collective Code Ownership
  • Continuous Integration
Refactoring
Wrap Return Value
                                                           Invert Boolean
                                                             Safe Delete
                                                      Move Instance Method
                                                           Inline Constant
                                                          Extract Subclass
                                                 Replace Method Code Duplicates
                                                   Convert To Instance Method
                                                                Rename
                                                 Move Inner Class to Upper Level
                                                     Change Method Signature
                                                        Make Method Static
                                                         Copy/Clone Class
                                                           Extract Method
                                                         Introduce Variable
                                                           Introduce Field
                                                        Introduce Constant
                                                       Introduce Parameter
                                                          Extract Interface       Inl
                                                                                      ine
        Safe Delete                                      Extract Superclass               Su




                                                                                  Intr
                                                                                            pe
                                                   Use Interface Where Possible                rcl




                                                                                      odu
                                                                                                   ass




                                             n
          Rename




                                       dle ct
                                          ma
                                                          Pull Members Up




                                    Mid je




                                                                                         ce
                                  ve Ob
                                                       Push Members Down




                                                                                        Par
     Move/Copy File                             Replace Inheritance with Delegation




                               mo d




                                                                                          am
                            Re etho
                                                        Inline Local Variable




                                                                                             e
    Introduce Variable




                                                                                              ter
                                M
                                                            Inline Method
                                              n
                            act




                                                                                               Ob
                                            io Convert Anonymous Class to Inner
                                        rat




                                                                                        Ex
                             tr
      Introduce Field                 g




                                                                                                 jec
                                   Mi




                                                                                          tra
                          Ex
                                                         Encapsulate Fields
                                 e




                                                                                                    t
                                                                                              ct
                               p                    Replace Temp With Query
                            Ty




                                                                                               Cl
   Introduce Constant




                                                                                                 as
                                            Replace Constructor With Factory Method




                                                                                                    s
JavaScript Refactorings                  Java Refactorings
Typical Java Web Template

 <div>
 	 <span>${title}</span>
 	 <a href="..."><img src="..."/></a>
 	 <a href="..."><img src="..."/></a>
 </div>
GWT Layout
label = new Label(title);
panel.add(label);

upButton = new Image("...");
panel.add(upButton);
	 	
removeButton = new Image("...");
panel.add(removeButton);
Refactored GWT


 new BookPanel(title);
Performance
Optimization
Better
“



    JavaScript code than
        you would write
          by hand            ”

                    - “Making GWT Better”
                      on GWT Project Page


                             photo by clothfairy
Optimizing
Compiler
             photo by ralphbijker
Name That Compile!
class
Calculator
{




public
int
add(int
x,
int
y)
{






return
x
+
y;




}
}

Calculator
myCalc
=
new
Calculator();
Window.alert((myCalc.add(3,
2));
Compiles To:


   alert(5)
Whole-Program
 Optimization
Whole-Program
        Optimization


               Compiler




Java Library              JavaScript
... but no reflection.



          X
 employee.set("firstName", "Fred");
photo by Alicia Solario




Simple Design
Test-Driven
Development
JUnit
TestNG



Concordion           Fit
Three ways to test
Plain JUnit
@Test
public
void
additionsGoToTopOfList()
{
  startingWithTitles("First added");

    model.addTitle("Second added");
    assertThat(model.getTitles().get(0),
               is("Second added"));
}
In a Real Browser
In the Hosted Mode
      Browser


 GWTTestCase
How do you test UI?
Model-View-Presenter
         View



       Presenter



        Model
photo by sanja gjenero




Collective Code
  Ownership
Same Code on
Browser and Server




        Java
       Object
Developers




Front End
                     Server Developers
Developers
Code-based UI Layout
 HorizontalPanel panel = new HorizontalPanel();
 panel.add(new TextBox());
 panel.add(new Button(...));
 panel.add(new Image(...);
:-)
Developers                        :-(
                                   UI Designers
Cross-browser CSS
        is still hard
Continuous
Integration




              photo by wilhei
Build Tools
Build Servers




           Hudson
Static Analysis
& Code Quality Tools




              Checkstyle
Image by Svilen Mushkatov




  When
  should you
  use GWT?
photo by Boby Dimitrov
Is this a web site
or a web application?




 Web site      Web application
photo by Vidiot
JUnit

   TestNG


                     Checkstyle
Concordion     Fit
Questions?
     Source code for the demo available on github:
http://github.com/pinfieldharm/Agile-2009-GWT-Demo

                  References and Resources:
                  http://tinyurl.com/agilegwt

Paul Infield-Harm                                  Daniel Wellman
 paul@infield-harm.org                             dan@danielwellman.com
 www.infield-harm.org                               blog.danielwellman.com


                        www.cyrusinnovation.com
                         New York • Boston

More Related Content

Similar to The Google Web Toolkit Experience

[A3]deview 2012 network binder
[A3]deview 2012 network binder[A3]deview 2012 network binder
[A3]deview 2012 network binder
NAVER D2
 
DejaVOO: A Regression Testing Tool for Java Software
DejaVOO: A Regression Testing Tool for Java SoftwareDejaVOO: A Regression Testing Tool for Java Software
DejaVOO: A Regression Testing Tool for Java Software
Manas Tungare
 
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Anton Arhipov
 
Java Reference
Java ReferenceJava Reference
Java Reference
khoj4u
 

Similar to The Google Web Toolkit Experience (11)

[A3]deview 2012 network binder
[A3]deview 2012 network binder[A3]deview 2012 network binder
[A3]deview 2012 network binder
 
[NHN] 성공적인 소셜게임 런칭과 기술
[NHN] 성공적인 소셜게임 런칭과 기술[NHN] 성공적인 소셜게임 런칭과 기술
[NHN] 성공적인 소셜게임 런칭과 기술
 
DejaVOO: A Regression Testing Tool for Java Software
DejaVOO: A Regression Testing Tool for Java SoftwareDejaVOO: A Regression Testing Tool for Java Software
DejaVOO: A Regression Testing Tool for Java Software
 
Java Modifiers Matrix
Java Modifiers MatrixJava Modifiers Matrix
Java Modifiers Matrix
 
2008 Sccc Inheritance
2008 Sccc Inheritance2008 Sccc Inheritance
2008 Sccc Inheritance
 
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
The DEVS-Driven Modeling Language: Syntax and Semantics Definition by Meta-Mo...
 
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
 
Java Reference
Java ReferenceJava Reference
Java Reference
 
RIA Patterns - Best Practices for Common Patterns of Rich Interaction
RIA Patterns - Best Practices for Common Patterns of Rich InteractionRIA Patterns - Best Practices for Common Patterns of Rich Interaction
RIA Patterns - Best Practices for Common Patterns of Rich Interaction
 
Apache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaApache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just Java
 
持续交付 - 使用云计算和虚拟化技术
持续交付 - 使用云计算和虚拟化技术持续交付 - 使用云计算和虚拟化技术
持续交付 - 使用云计算和虚拟化技术
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

The Google Web Toolkit Experience