GWT - AppDays - (25 aprile 2014, pordenone)


Published on

Slides del talk tenuto a
Pordenone in occasione dellgli AppDays Intorduzione a GWT.

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

GWT - AppDays - (25 aprile 2014, pordenone)

  1. 1. GWT-Kickoff Alberto Mancini - Francesca Tosi - Kickoff
  2. 2. Alberto
  3. 3. Francesca +FrancescaTosi @francescatosi
  4. 4. GDGFirenze +GDG-Firenze
  5. 5. GWTcos’è Google Web Toolkit (GWT) is an open source Java software development kit that makes writing AJAX applications like Google Maps and Gmail easy for developers.
  6. 6. GWTStats Official GWT Report by Vaadin [2012] - portlet/download/1871870899/Future-of-GWT-Report-2012. pdf [2013] - (del 10/04/2014 → GWT in crescita) 8aa8-fe46129353a3
  7. 7. GWTStats E’ uno fra i framework più utilizzati coders-java-web-frameworks-comparison-spring- mvc-grails-vaadin-gwt-wicket-play-struts-and-jsf/
  8. 8. GWTStats Come viene principalmente utilizzato
  9. 9. GWTStats Browser & platform support.
  10. 10. GWTStats GWT è molto usato in Europa
  11. 11. GWTStats GWT why i love it ;-)
  12. 12. GWTStats GWT the dark side
  13. 13. rightfor?
  14. 14. GWTStats as of Q4/2012 ● SDK downloaded over 1 million times ● 100,000+ Active Developers ● Deep Integration with Eclipse, IntelliJ, Spring STS/Roo ● Used by Google products such as AdWords, Flights, Wallet ● Fun things: GwtQuake, Angry Birds for the Web ● GWT Today is a mature, high quality, code base.
  15. 15. ...notaFramework Frameworks that may help model-view-presenter framework CDI, and JPA for GWT app framework (on gwt-pectin)
  16. 16. Ecosystem Sencha’s GXT -
  17. 17. Why Why?
  18. 18. FOSS The GWT Steering committee was founded in 2012 to help the GWT project become an even bigger success as an open source project. ● Ray Cromwell, Google ● Artur Signell, Vaadin ● Colin Alworth, Sencha ● Mike Brock, RedHat ● Thomas Broyer ● Stephen Haberman, Bizo ● Daniel Kurka, Google ● Christian Goudreau, Arcbees ● Konstantin Solomatov, Jetbrains
  19. 19. Evolving&Mature Rev. Improvements 2006 GWT 1.0 2007 GWT 1.3/GWT 1.4 First Open Source Release, OSX support / JUnit and ImageBundle 2008 GWT 1.5 Java 1.5 support, Overlay Types, DOM API, CSS Themes, Linkers 2009 GWT 1.6/GWT 1.7 GWT 2.0 EventHandlers, EMMA Support, WAR support, Parallelized Builds/Newer browser support, IE8, GPE and AppEngine/DevMode, DraftCompile, UIBinder, LayoutPanel, CodeSplitter, ClientBundle, CssResource 2010 GWT 2.1 RequestFactory, Editor Framework, Validation, MVP, Cell Widgets 2011 GWT 2.2/GWT 2.3 GWT 2.4 GWT Designer, HTML5 support/Better AppEngine integration/Maven and RequestFactory enhancements 2012 GWT 2.5 SuperDevMode, Elemental, UiRenderers, FragmentMerging, ClosureCompiler
  20. 20. Browsers
  21. 21. Browsers
  22. 22. xché una codebase e tante 'incarnazioni' dell'applicazione.
  23. 23. Borntobe... Why GWT? The beginnings of rich internet applications started taking off in 2004-2005 with Gmail/Google Maps. jQuery didn't even exist yet. There was a vacuum for tools to build large scale web applications, and leveraging the already mature Java toolchain of IDEs, libraries, build tools, testing frameworks, made good sense. Ray Cromwell
  24. 24. Nowadays ● Plethora of languages compiling to js (..., python, C/C++, Ocaml, Haskel, ...) ● Good and awesome js libraries & frameworks Closure Tools
  25. 25. Secondonoi ● non tutte le applicazioni sono uguali ● ed alle volte alcune richiedono strumenti inustitati
  26. 26. GWT-Boofcv GWT-Boofcv sample at:
  27. 27. DEMO
  28. 28. MarkerBasedAR
  29. 29. Mobile(&tab)too
  30. 30. ComeFunziona <video/> <canvas/> Ny HTTP
  31. 31. java→GWT Using Java libraries into the browser
  32. 32. JS→GWT Using js libraries with java
  33. 33. Deeper Deeper.
  34. 34. GWT GWT is a toolkit to develop Ajax web application with Java. The programmer writes Java code and this code is translated into HTML and Javascript via the GWT compiler. The compiler creates browser specific HTML and JavaScript to support all the major browsers correctly.
  35. 35. ToolsintheToolkit + GWTc, compiler Java to Javascript + Emulated JRE + Web UI class library (Widgets) + Eclipse Plugin, SpeedTracer, Designer It's open source, completely free, and used by thousands of developers around the world (in Google AdWords,Orkut, Blogger,Groups)
  36. 36. Compiler GWT compiler ● java to javascript optimizing compiler ● translates java AST into js AST ● splits code into fragments to improve loading performance
  37. 37. Linker ● responsible for the final form of the generated js xsiframe is the standard one there are linkers for generating web-workers, gadgets, chrome extensions, …
  38. 38. deferredbinding Deferred Binding: feature of the GWT compiler that works by generating many versions of code at compile time, only one of which needs to be loaded by a particular client during bootstrapping at runtime. Each version is generated on a per browser basis, along with any other axis that your application defines or uses. RPC Calls Widgets tuned for specific browsers Internationalization
  39. 39. deferredbinding Deferred binding has several benefits: ● Reduces the size of the generated JavaScript code (downloaded by each client) - including just the code needed to run the browser/locale instance (used by the Internationalization module) ● Automatic generation of code (saving development time) to implement an interface or create a proxy class (used by the GWT RPC module) ● Since the implementations are pre-bound at compile time, there is no run-time penalty to look up an implementation in a data structure as with dynamic binding or using virtual functions.
  40. 40. EmulatedJRE GWT includes a library that emulates a subset of the Java runtime library. InputStream Threads ?
  41. 41. JNSI GWT borrows from the Java Native Interface (JNI) concept to implement JavaScript Native Interface (JSNI). Writing JSNI methods is a powerful technique, but should be used sparingly because writing bulletproof JavaScript code is notoriously tricky. Needed for JSO (Javascript Overlay Types)
  42. 42. JNSI public static native void alert(String msg) /*-{ $wnd.alert(msg); }-*/; $wnd: the root browser window GWT widgets are being rendered to $entry(..): method that makes code reentry safe.
  43. 43. Widgets UiComponents 2.0+ LayoutPanels from the Jul 2013 - GWT Meetup What are some of pain points or decisions bad in hindsight? ... ● Bad out of box UI ... SmartGWT, GXT
  44. 44. UiBinder ● The UiBinder is a framework designed to separate Functionality and View of User Interface. ● The UiBinder framework allows developers to build gwt applications as HTML pages with GWT widgets configured throughout them. ● The UiBinder framework makes easier collaboration with UI designers who are more comfortable with XML, HTML and CSS than Java source code ● The UIBinder provides a declarative way of defining (parts of the) User Interface. ● The UIBinder seperates the programmic logic from UI. ● The UIBinder is similar to what JSP is to Servlets.
  45. 45. UiBinder ● DSL (xml) to lay-out (declaratively) widgets ● no loops, no conditionals, no if statements ● UiBinder allows you to lay out your user interface. ● (offers direct support for internationalization)
  46. 46. GWT-RPC Lets the client and the server to exchange java objects over http.
  47. 47. BattlePlan Domani: ● Codelab 2h: GWT mobile app 10:30 → 12:30 ● Codelab 4h: GWT hands-on 14:00 → 18:00
  48. 48. Thanks Alberto Mancini Francesca Tosi