200 likes | 390 Views
Google Web Toolkit. Paul Heiniz , Wolfgang Kluth , Jan Marten, Malte Behrendt. The slides are licensed under a Creative Commons Attribution 3.0 License. Outline. Introduction Features of GWT In Browser Development Mode Java- to -JavaScript Compiler Server Communication
E N D
Google Web Toolkit Paul Heiniz, Wolfgang Kluth, Jan Marten, MalteBehrendt The slides are licensed under aCreative Commons Attribution 3.0 License Web Technologies – Prof. Dr. Ulrik Schroeder – WS 2010/11
Outline • Introduction • Features of GWT • In Browser Development Mode • Java-to-JavaScript Compiler • Server Communication • Model-View-Presenter Design Pattern • Hands-on • Hello World (GWT 1.x) • Hello World (GWT 2.1) • Hello World (GWT 2.1 RPC) • Summary Web Technologies
Introduction • Whatis GWT? • Development Toolkit for Browser-basedApplications • Application Development in Java • Type-Safe Language • Nomemory-leaks • TestingwithJunit • Java-IDEs (Eclipse-Plugin) • ApplicationDeployment in HTML/AJAX • Java-to-JavaScript/HTML (AJAX) Compiler Web Technologies
Features • Core featuresof GWT • Java-to-JavaScript/HTML Compiler • HighlyoptimizedJavaScript • Browser independence/Deferred Binding • Easy Internationalization • History Support • Safe HTML • JavaScript Native Interface • UI-Binder • Code in Java, Layout in CSS • Developer Mode • LocalTestingand Debugging • Speed Tracer Web Technologies
Features • Features of GWT • Manyready-to-useWidgets • Composites Web Technologies
Features • Disadvantagesof GWT • Dependence on Google • Learning curve • Exampleapplications • Orkut • Google Wave • Google Adwords Web Technologies
Outline • Introduction • Features of GWT • In Browser Development Mode • Java-to-JavaScript Compiler • Server Communication • Model-View-PresenterDesign Pattern • Hands-on • Hello World (GWT 1.x) • Hello World (GWT 2.1) • Hello World (GWT 2.1 RPC) • Summary Web Technologies
In-Browser Development Mode • Actual rendering is done in browser • Code runs as Java Bytecode → Debugging! Web Technologies
Java-to-JavaScript Compiler • JRE Emulation Library → used for developer mode • Most ofjava.lang • Most ofjava.util • Some java.io, java.sql • Compiler → Generates JavaScript from the Java source code • JavaScript in GWT is like bytecode for Java Applications • Optimization → often better than hand coding • Dead Code Elimination • Constant Folding • Copy Propagation • String Interning • … Web Technologies
Server Communication • GWT RPC • Based on/are Java Servlets • Other • (HTTP-) RequestBuilder + JSON or XML • JSNI Methods • Third-Party libraries (e.g. for PHP) Web Technologies
Design Patterns Challenges when building large scale applications Multiple developers working simultaneously Maintaining legacy functionality Messy code... Solution: separation of concerns (by Design Patterns) For example: Model-View-Controller Web Technologies
Design Pattern: MVP MVP: Structure application into Model: Encompass objects View: UI Components/Layout + UI Event Handling Presenter: Application Logic (AppController: Application Layer Logic) GWT 2.1 offers a MVP Framework Activities (Presenter) Places (UI State) Web Technologies
Outline • Introduction • Features of GWT • In Browser Development Mode • Java-to-JavaScript Compiler • Server Communication • Model-View-PresenterDesign Pattern • Hands-on • Hello World (GWT 1.x) • Hello World (GWT 2.1) • Hello World (GWT 2.1 RPC) • Summary Web Technologies
Summary Web Technologies
Hands – On - HelloWorld (GWT 1.x) Web Technologies
Hands – On - HelloWorld (GWT 1.x) • Hello World (GWT 1.x) • Live Demonstration • Show Developer Mode • Show result/Hello World Web Technologies
Hands – On - Hello World (GWT 2.1) UI XML-File: Web Technologies
Hands – On - Hello World (GWT 2.1) Java-Code: Web Technologies
Hands – On - Hello World (GWT 2.1) • Hello World (GWT 2.1) • Live Demonstration • Result/Hello World Web Technologies
Hands – On - HelloWorld (GWT 2.1) • Live Demonstration • Result/Hello World • FieldVerifier Web Technologies