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 binderNAVER D2
 
[NHN] 성공적인 소셜게임 런칭과 기술
[NHN] 성공적인 소셜게임 런칭과 기술[NHN] 성공적인 소셜게임 런칭과 기술
[NHN] 성공적인 소셜게임 런칭과 기술GAMENEXT Works
 
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 SoftwareManas Tungare
 
2008 Sccc Inheritance
2008 Sccc Inheritance2008 Sccc Inheritance
2008 Sccc Inheritancebergel
 
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...Daniele Gianni
 
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 2012Anton Arhipov
 
Java Reference
Java ReferenceJava Reference
Java Referencekhoj4u
 
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 Interactioninteractionpatterns.org
 
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 JavaMartijn Dashorst
 
持续交付 - 使用云计算和虚拟化技术
持续交付 - 使用云计算和虚拟化技术持续交付 - 使用云计算和虚拟化技术
持续交付 - 使用云计算和虚拟化技术foxgem
 

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

Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 

Recently uploaded (20)

Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 

The Google Web Toolkit Experience