SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 
持续交付 - 使用云计算和虚拟化技术
持续交付 - 使用云计算和虚拟化技术持续交付 - 使用云计算和虚拟化技术
持续交付 - 使用云计算和虚拟化技术
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 

The Google Web Toolkit Experience