SlideShare une entreprise Scribd logo
1  sur  60
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à 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
 

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

Dernier

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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...Igalia
 
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.pptxMalak Abu Hammad
 
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 Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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 slidevu2urc
 
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.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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 MountPuma Security, LLC
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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...Miguel Araújo
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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 interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Dernier (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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...
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

The Google Web Toolkit Experience