SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
Google Web Toolkit
- Build Rich Web
Applications with
OO Tools
Benjamin Arciszewski
Senior Software Engineer - StudyBlue
Today's Agenda
● Introduce GWT and talk about what it is, why
  it's different and why you should use it
● Talk about good/bad of the toolkit
● Describe the components of GWT at a high
  level
● Go through the anatomy of a project
● Walk through a sample app that is a little
  more complex than 'hello world'
● Bring it all together by showing some of the
  functionality on StudyBlue.com
Purpose
To get you excited about GWT and to build a
large community of GWT users in Wisconsin so
StudyBlue has a large pool of qualified
developers to choose from as we grow...
Something to think about...
How many Java LOC are in the StudyBlue Web
application (method used is Eclipse metrics
plugin, only com.sb.* packages)?
10 Second History of the Web
●   Web pages
●   Interactive Web pages
●   Web applications
●   Rich Internet Applications
Traditional Frameworks
● MVC
  ○ Struts
  ○ Struts II
● Component-based
  ○ JSF
  ○ Tapestry
● SOUI (AJAX)
  ○ Ext JS
  ○ DOJO
  ○ jQuery
Difficulty of traditional MVC
frameworks
● Mixed languages
  ○ Server
    ■ java, ruby, php, C#,...
    ■ templates (HTML,XML, markup...)
    ■ Glue languages (OGNL)
  ○ Client
    ■ JavaScript
    ■ HTML
● Server vs. Client
  ○ No sharing of code
  ○ Lots of config
  ○ Lots of conversion
Difficulty of Traditional Web
Frameworks, continued
● Complex project setups
  ○   Server-side code
  ○   Client side code
  ○   Templates
  ○   Static files
  ○   JavaScripts
Ultimate Issue?
● They all treat Rich Internet Applications as
  Web Pages!
Browser?
●   Rich Object Model
●   Performant Script processing engine (V8)
●   Local persistence
●   Rich Graphics (Canvas)
●   Rich set of programming APIs
●   Complete set of events
What is GWT?
Google Web Toolkit (GWT) is a development
toolkit for building and optimizing complex
browser-based applications. GWT is used by
many products at Google, including Google
AdWords and Orkut. It's open source,
completely free, and used by thousands of
developers around the world.

From:https://developers.google.com/web-toolkit/
What is GWT?
GWT, aka the Google Web Toolkit, or "Gwit" as their team
likes to say (which is a stupid pronunciation), is a Java skin
on the Javascript language. It allows objected oriented,
strictly-typed programming fans to work seamlessly with
pixel perfect, anal retentive HTML/CSS gurus. In addition it
provides tons of optimizations for code efficiency,
internationalization, resource bundling, etc. Finally, it's
flexible enough that you can bake it into any type of web
application, using any type of server-client communication

From:Chris Klunt, President andCo-Founder - StudyBlue
What is GWT?

GWT is a client-side framework for
developing rich internet applications in
Java, taking advantage of all of the
tools that come with a high-level
language like Java.
From:Dale Beerman, Chief Technical Architect - StudyBlue
How GWT is Different
● Code is in Java (mostly)
● 'compiled' to js/html
● No need for
   ○ page templates
   ○ 'glue languages'
   ○ scripting
● Full use of Java tool stack
   ○ Eclipse debugger
   ○ Code complete
   ○ Continuous compilation
● Shared code between client/server
Practical Description of GWT
● Set of tools that turn Java into html/js.
  ○ Eclipse Plugin
  ○ Project Generator
  ○ J2SE proxy libraries
  ○ Compiler
  ○ Browser Plugin (for development)
  ○ Java Widget and Service API
  ○ RPC mechanism
  ○ WYSIWYG Visual Editor (We don't use)
Advantages for doing it this way...
● Code is optimized for each browser during
  compile (read: optimization)
● Full OO abstractions: inheritance,
  polymorphism, encapsulation, extension
● One single language (mostly)
● Ability to bind to 'native' JS when needed
● Code re-use
   ○ Components, Widgets and Services
● High quality, easily usable, libraries
Disadvantages
● Compile can be slow (especially w/ i18n)
  ○ One version for each browser, for each language,
    exponential growth...
● Plugin used for local testing in browser
● Give up some control (but not as much as
  you might think)
● GWT Unit tests are SLOW
● You sometimes think you are in Java
Anatomy of a GWT Project
● Java code
   ○ client - compiled to js/html and run in browser
   ○ server - compiled to java and run on server
   ○ shared - both (must be compliant w/ client)
● .gwt.xml - configuration file
● .html host file - that will include your code
● .css file - for styling
GWT - RPC
● It's like magic
   ○ Define an Interface
   ○ Define an implementation in server
   ○ Define an implementation w/ callback in client.
● To Configure
   ○ Create an interface in client
   ○ Create an asynchronous interface in client
   ○ Create an implementation on server that extends
     RemoteServiceServlet
   ○ Configure Servlet in web.xml
● To use
   ○ Get the Async version from GWT (GWT.create)
   ○ Make calls, receive response in Callback
UI code
● Widgets (Java objects)
  ○ Your code creates views via Extension and/or
      Composition
●   Customizable
●   Configurable
●   Similar to Swing
●   Extensible
●   Optional .ui.xml file bindings (StudyBlue)
Project Structure
Organization - Config
Organization - src
Organization - war
Interaction - Host Page - JavaScript

<script type="text/javascript" language="
javascript" src="jugsampleapp/jugsampleapp.
nocache.js"></script>
Interaction - Host page - Elements

  <h1>JUG Sample Application</h1>
 <div id="searchWrapper">
    <div id="editor"><!-- GWT ... --></div>
    <div id="buttons"><!-- GWT ... --></div>
   </div>

<div id="cardWall">
   <div id="cardList" class="cardBox"><!-- GWT ... --></div>
</div>
Interaction - Execution Start
● EntryPoint.onModuleLoad
● In our sample: JugSampleApp
Interaction - RPC
● CardService (client)
● CardServiceAsync (client)
● CardServiceImpl extends
  RemoteServiceServlet implements
  CardService(server)
Sample Project
Bring it together - Cardwall
Bring it all together - Preview
Bring it all together - Edit
Bring it all together - Flip
Bring it all together - Quiz
How many LOC are in our app?
Answer:

      About 66,000
StudyBlue



Any questions?
Benjamin Arciszewski
Senior Software Engineer - StudyBlue

Weitere ähnliche Inhalte

Was ist angesagt?

Quick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptQuick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using Javascript
Robert Ellen
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
Horacio Gonzalez
 

Was ist angesagt? (20)

Akademy 2010 presentation
Akademy 2010 presentationAkademy 2010 presentation
Akademy 2010 presentation
 
GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)GWT - AppDays - (25 aprile 2014, pordenone)
GWT - AppDays - (25 aprile 2014, pordenone)
 
OpenCms Days 2012 - OpenCms 8.5: Creating "in place" editable pages with the ...
OpenCms Days 2012 - OpenCms 8.5: Creating "in place" editable pages with the ...OpenCms Days 2012 - OpenCms 8.5: Creating "in place" editable pages with the ...
OpenCms Days 2012 - OpenCms 8.5: Creating "in place" editable pages with the ...
 
Quick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using JavascriptQuick Review of Desktop and Native Apps using Javascript
Quick Review of Desktop and Native Apps using Javascript
 
Developing a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&CordovaDeveloping a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&Cordova
 
Code-Hub
Code-HubCode-Hub
Code-Hub
 
Nuxeo World Session: GWT Integration
Nuxeo World Session: GWT IntegrationNuxeo World Session: GWT Integration
Nuxeo World Session: GWT Integration
 
Full stack development
Full stack developmentFull stack development
Full stack development
 
Chromium on Wayland Desktop (BlinkOn 7)
Chromium on Wayland Desktop (BlinkOn 7)Chromium on Wayland Desktop (BlinkOn 7)
Chromium on Wayland Desktop (BlinkOn 7)
 
Meetup - Building by Composition - Samuel Jesus
Meetup - Building by Composition - Samuel JesusMeetup - Building by Composition - Samuel Jesus
Meetup - Building by Composition - Samuel Jesus
 
The Internal Architecture of Chrome Developer Tools
The Internal Architecture of Chrome Developer ToolsThe Internal Architecture of Chrome Developer Tools
The Internal Architecture of Chrome Developer Tools
 
React Typescript for beginners: Translator app with Microsoft cognitive services
React Typescript for beginners: Translator app with Microsoft cognitive servicesReact Typescript for beginners: Translator app with Microsoft cognitive services
React Typescript for beginners: Translator app with Microsoft cognitive services
 
LCU14 208- Chromium-Blink Migration for RDK
LCU14 208- Chromium-Blink Migration for RDKLCU14 208- Chromium-Blink Migration for RDK
LCU14 208- Chromium-Blink Migration for RDK
 
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
 
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
Hybrid Desktop/Web applications with WebKitGTK+ (COSCUP 2010)
 
Intro to node.js
Intro to node.jsIntro to node.js
Intro to node.js
 
React JS Belgium Touch Base - React, Flux, React Native
React JS Belgium Touch Base - React, Flux, React NativeReact JS Belgium Touch Base - React, Flux, React Native
React JS Belgium Touch Base - React, Flux, React Native
 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
 
Javascript and DOM
Javascript and DOMJavascript and DOM
Javascript and DOM
 
Gwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca TosiGwt kickoff - Alberto Mancini & Francesca Tosi
Gwt kickoff - Alberto Mancini & Francesca Tosi
 

Andere mochten auch

Pdhpe Benefits
Pdhpe BenefitsPdhpe Benefits
Pdhpe Benefits
a_jones77
 
Uesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddyUesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddy
Freddy Jijon
 
Photo slideshow- music
Photo slideshow- musicPhoto slideshow- music
Photo slideshow- music
a_jones77
 
Photo slideshow- Sports
Photo slideshow- SportsPhoto slideshow- Sports
Photo slideshow- Sports
a_jones77
 
Uesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddyUesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddy
Freddy Jijon
 
Being Distracting Passengers
Being Distracting PassengersBeing Distracting Passengers
Being Distracting Passengers
a_jones77
 
Presentation1
Presentation1Presentation1
Presentation1
a_jones77
 
2012 uesjls-1a-t1-jijonveliz
2012 uesjls-1a-t1-jijonveliz2012 uesjls-1a-t1-jijonveliz
2012 uesjls-1a-t1-jijonveliz
Freddy Jijon
 

Andere mochten auch (18)

Pdhpe Benefits
Pdhpe BenefitsPdhpe Benefits
Pdhpe Benefits
 
Aac pres
Aac presAac pres
Aac pres
 
User Awarness Programme@Central Library, Tripura university
User Awarness Programme@Central Library, Tripura universityUser Awarness Programme@Central Library, Tripura university
User Awarness Programme@Central Library, Tripura university
 
Uesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddyUesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddy
 
Photo slideshow- music
Photo slideshow- musicPhoto slideshow- music
Photo slideshow- music
 
Photo slideshow- Sports
Photo slideshow- SportsPhoto slideshow- Sports
Photo slideshow- Sports
 
Batuan(1)
Batuan(1)Batuan(1)
Batuan(1)
 
Uesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddyUesjls 2012-jijonfreddy
Uesjls 2012-jijonfreddy
 
Proposal
ProposalProposal
Proposal
 
Being Distracting Passengers
Being Distracting PassengersBeing Distracting Passengers
Being Distracting Passengers
 
Presentation1
Presentation1Presentation1
Presentation1
 
Romance%20on%20 facebook
Romance%20on%20 facebookRomance%20on%20 facebook
Romance%20on%20 facebook
 
SNCE (Moscow) - Mike Litson
SNCE (Moscow) - Mike LitsonSNCE (Moscow) - Mike Litson
SNCE (Moscow) - Mike Litson
 
2012 uesjls-1a-t1-jijonveliz
2012 uesjls-1a-t1-jijonveliz2012 uesjls-1a-t1-jijonveliz
2012 uesjls-1a-t1-jijonveliz
 
Trabalhos em altura_em_espacos_confinados_gianfranco_sinesc
Trabalhos em altura_em_espacos_confinados_gianfranco_sinescTrabalhos em altura_em_espacos_confinados_gianfranco_sinesc
Trabalhos em altura_em_espacos_confinados_gianfranco_sinesc
 
Promotion of e shodh sindhu journals &amp; databases in tripura university li...
Promotion of e shodh sindhu journals &amp; databases in tripura university li...Promotion of e shodh sindhu journals &amp; databases in tripura university li...
Promotion of e shodh sindhu journals &amp; databases in tripura university li...
 
Yandex SEO Presentation
Yandex SEO PresentationYandex SEO Presentation
Yandex SEO Presentation
 
Egr ppt
Egr pptEgr ppt
Egr ppt
 

Ähnlich wie GWT - Building Rich Internet Applications Using OO Tools

Introduction to Google Web Toolkit
Introduction to Google Web ToolkitIntroduction to Google Web Toolkit
Introduction to Google Web Toolkit
Didier Girard
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
Rodrigo Gil
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
lolopetit
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer
 

Ähnlich wie GWT - Building Rich Internet Applications Using OO Tools (20)

Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Introduction to Google Web Toolkit
Introduction to Google Web ToolkitIntroduction to Google Web Toolkit
Introduction to Google Web Toolkit
 
GWT + Gears : The browser is the platform
GWT + Gears : The browser is the platformGWT + Gears : The browser is the platform
GWT + Gears : The browser is the platform
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Web summit.pptx
Web summit.pptxWeb summit.pptx
Web summit.pptx
 
Gwt Presentation1
Gwt Presentation1Gwt Presentation1
Gwt Presentation1
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
Introduction to serverless computing on Google Cloud
Introduction to serverless computing on Google CloudIntroduction to serverless computing on Google Cloud
Introduction to serverless computing on Google Cloud
 
Dust.js
Dust.jsDust.js
Dust.js
 
Front-End Developer's Career Roadmap
Front-End Developer's Career RoadmapFront-End Developer's Career Roadmap
Front-End Developer's Career Roadmap
 
Making sense of the front-end, for PHP developers
Making sense of the front-end, for PHP developersMaking sense of the front-end, for PHP developers
Making sense of the front-end, for PHP developers
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10
 
GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day GWT Introduction for Eclipse Day
GWT Introduction for Eclipse Day
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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...
 
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
 
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)
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
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?
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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...
 
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
 

GWT - Building Rich Internet Applications Using OO Tools

  • 1. Google Web Toolkit - Build Rich Web Applications with OO Tools Benjamin Arciszewski Senior Software Engineer - StudyBlue
  • 2. Today's Agenda ● Introduce GWT and talk about what it is, why it's different and why you should use it ● Talk about good/bad of the toolkit ● Describe the components of GWT at a high level ● Go through the anatomy of a project ● Walk through a sample app that is a little more complex than 'hello world' ● Bring it all together by showing some of the functionality on StudyBlue.com
  • 3. Purpose To get you excited about GWT and to build a large community of GWT users in Wisconsin so StudyBlue has a large pool of qualified developers to choose from as we grow...
  • 4. Something to think about... How many Java LOC are in the StudyBlue Web application (method used is Eclipse metrics plugin, only com.sb.* packages)?
  • 5. 10 Second History of the Web ● Web pages ● Interactive Web pages ● Web applications ● Rich Internet Applications
  • 6. Traditional Frameworks ● MVC ○ Struts ○ Struts II ● Component-based ○ JSF ○ Tapestry ● SOUI (AJAX) ○ Ext JS ○ DOJO ○ jQuery
  • 7. Difficulty of traditional MVC frameworks ● Mixed languages ○ Server ■ java, ruby, php, C#,... ■ templates (HTML,XML, markup...) ■ Glue languages (OGNL) ○ Client ■ JavaScript ■ HTML ● Server vs. Client ○ No sharing of code ○ Lots of config ○ Lots of conversion
  • 8. Difficulty of Traditional Web Frameworks, continued ● Complex project setups ○ Server-side code ○ Client side code ○ Templates ○ Static files ○ JavaScripts
  • 9. Ultimate Issue? ● They all treat Rich Internet Applications as Web Pages!
  • 10. Browser? ● Rich Object Model ● Performant Script processing engine (V8) ● Local persistence ● Rich Graphics (Canvas) ● Rich set of programming APIs ● Complete set of events
  • 11. What is GWT? Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications. GWT is used by many products at Google, including Google AdWords and Orkut. It's open source, completely free, and used by thousands of developers around the world. From:https://developers.google.com/web-toolkit/
  • 12. What is GWT? GWT, aka the Google Web Toolkit, or "Gwit" as their team likes to say (which is a stupid pronunciation), is a Java skin on the Javascript language. It allows objected oriented, strictly-typed programming fans to work seamlessly with pixel perfect, anal retentive HTML/CSS gurus. In addition it provides tons of optimizations for code efficiency, internationalization, resource bundling, etc. Finally, it's flexible enough that you can bake it into any type of web application, using any type of server-client communication From:Chris Klunt, President andCo-Founder - StudyBlue
  • 13. What is GWT? GWT is a client-side framework for developing rich internet applications in Java, taking advantage of all of the tools that come with a high-level language like Java. From:Dale Beerman, Chief Technical Architect - StudyBlue
  • 14. How GWT is Different ● Code is in Java (mostly) ● 'compiled' to js/html ● No need for ○ page templates ○ 'glue languages' ○ scripting ● Full use of Java tool stack ○ Eclipse debugger ○ Code complete ○ Continuous compilation ● Shared code between client/server
  • 15. Practical Description of GWT ● Set of tools that turn Java into html/js. ○ Eclipse Plugin ○ Project Generator ○ J2SE proxy libraries ○ Compiler ○ Browser Plugin (for development) ○ Java Widget and Service API ○ RPC mechanism ○ WYSIWYG Visual Editor (We don't use)
  • 16. Advantages for doing it this way... ● Code is optimized for each browser during compile (read: optimization) ● Full OO abstractions: inheritance, polymorphism, encapsulation, extension ● One single language (mostly) ● Ability to bind to 'native' JS when needed ● Code re-use ○ Components, Widgets and Services ● High quality, easily usable, libraries
  • 17. Disadvantages ● Compile can be slow (especially w/ i18n) ○ One version for each browser, for each language, exponential growth... ● Plugin used for local testing in browser ● Give up some control (but not as much as you might think) ● GWT Unit tests are SLOW ● You sometimes think you are in Java
  • 18. Anatomy of a GWT Project ● Java code ○ client - compiled to js/html and run in browser ○ server - compiled to java and run on server ○ shared - both (must be compliant w/ client) ● .gwt.xml - configuration file ● .html host file - that will include your code ● .css file - for styling
  • 19. GWT - RPC ● It's like magic ○ Define an Interface ○ Define an implementation in server ○ Define an implementation w/ callback in client. ● To Configure ○ Create an interface in client ○ Create an asynchronous interface in client ○ Create an implementation on server that extends RemoteServiceServlet ○ Configure Servlet in web.xml ● To use ○ Get the Async version from GWT (GWT.create) ○ Make calls, receive response in Callback
  • 20. UI code ● Widgets (Java objects) ○ Your code creates views via Extension and/or Composition ● Customizable ● Configurable ● Similar to Swing ● Extensible ● Optional .ui.xml file bindings (StudyBlue)
  • 25. Interaction - Host Page - JavaScript <script type="text/javascript" language=" javascript" src="jugsampleapp/jugsampleapp. nocache.js"></script>
  • 26. Interaction - Host page - Elements <h1>JUG Sample Application</h1> <div id="searchWrapper"> <div id="editor"><!-- GWT ... --></div> <div id="buttons"><!-- GWT ... --></div> </div> <div id="cardWall"> <div id="cardList" class="cardBox"><!-- GWT ... --></div> </div>
  • 27. Interaction - Execution Start ● EntryPoint.onModuleLoad ● In our sample: JugSampleApp
  • 28. Interaction - RPC ● CardService (client) ● CardServiceAsync (client) ● CardServiceImpl extends RemoteServiceServlet implements CardService(server)
  • 30. Bring it together - Cardwall
  • 31. Bring it all together - Preview
  • 32. Bring it all together - Edit
  • 33. Bring it all together - Flip
  • 34. Bring it all together - Quiz
  • 35. How many LOC are in our app?
  • 36. Answer: About 66,000