Your SlideShare is downloading. ×
0
Best practices for structuring
  large GWT applications
     Heiko Braun <hbraun@redhat.com>
About me

•   Heiko Braun
•   Senior Software Engineer JBoss / Red Hat
•   4 years JBoss, 12 years industry
•   Focus on S...
Topics


•   GWT in 5 minutes
•   Decomposing a large GWT application
•   Introducing Project Errai
What is GWT?
Write AJAX in the Java language
Google Web Toolkit
•   SDK: API, Compiler, Hosted Mode Browser

•   Write AJAX apps in the Java language, then compile to
...
GWT Features
•   Communicate with your server through really simple RPC

•   Reuse UI components across projects

•   Use ...
Decomposing large
GWT applications
Example: BPM console
Challenge #1:Feature Set

       •   Different features per:
           •   Target runtime
           •   Development stag...
Solution #1:
         Workspace plugins
•   Determined at compile time
•   Based on Maven dependency sets
•   Using Deferr...
Solution #1:
                                 Workspace plugins
(1) ‘mvn -Dconsole.profile=drools install’


              ...
Limitation #1:
        Component interplay
•   Each plugin component isolated
•   No interplay possible
    •   It would i...
Challenge #2:
      Interplay w/o dependencies
       •     Model-View-Controller ?

            •       Less coupled, but...
Solution #2: Pub/Sub
       •      Messaging through publish / subscribe

       •      Messaging API only shared dependen...
Limitation #2: Pub/Sub

•   Decoupling through de-typed nature
    •   No compile-time checking
•   Exchange protocol (con...
Challenge #3:
Server side capabilities
•   Backend capabilities may change as well

    •   Staging vs. production

    • ...
Solution #3: Bootstrap
                  •      Bootstrap: “Give me a list of capabilities”

                       •     ...
Solution #3: Messaging w. Presence

             •      Presence: “Need a plumber. Please call XYZ”

                  •  ...
Introducing Project Errai
Project Errai
•   Consolidates JBoss GWT efforts
•   Both R&D and actual product development
    •   Work in progress
•   ...
Errai-Bus
•   Backbone to application
    design

•   Common architecture
    across client&server

•   Enables federated
...
Errai-Bus API:
 Common to client & server
(1) Client: Publish                              (2) Server: Subscribe




•    ...
Errai-Workspaces
•   UI environment for which to deploy your console

•   Develop against a common workspace API

•   Prov...
Workspaces API
        •     Evolution of the property based config

        •     Uses Deferred Binding as well


(1) Anno...
Errai Widgets
• Complements OSS offering (i.e. Mosaic)
Putting it all together
•   Baseline and best
    practices

•   Free composition of
    console components

•   Different...
Demo Applications
Q&A
Upcoming SlideShare
Loading in...5
×

GWT Jug Stuttgart

4,972

Published on

Structuring large GWT applications

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,972
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
100
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "GWT Jug Stuttgart"

  1. 1. Best practices for structuring large GWT applications Heiko Braun <hbraun@redhat.com>
  2. 2. About me • Heiko Braun • Senior Software Engineer JBoss / Red Hat • 4 years JBoss, 12 years industry • Focus on SOA, BPM, GWT • Contributor: JBossWS, jBPM, Riftsaw, Errai, SAM, Savarra
  3. 3. Topics • GWT in 5 minutes • Decomposing a large GWT application • Introducing Project Errai
  4. 4. What is GWT?
  5. 5. Write AJAX in the Java language
  6. 6. Google Web Toolkit • SDK: API, Compiler, Hosted Mode Browser • Write AJAX apps in the Java language, then compile to optimized JavaScript • Edit Java code, then view changes immediately without re-compiling • Step through live AJAX code with your Java debugger • Compile and deploy optimized, cross-browser JavaScript
  7. 7. GWT Features • Communicate with your server through really simple RPC • Reuse UI components across projects • Use other JavaScript libraries and native JavaScript code • Localize applications • Choice of development tools • Test your code with JUnit • Open Source
  8. 8. Decomposing large GWT applications
  9. 9. Example: BPM console
  10. 10. Challenge #1:Feature Set • Different features per: • Target runtime • Development stage • Project lifecycle • Target audience
  11. 11. Solution #1: Workspace plugins • Determined at compile time • Based on Maven dependency sets • Using Deferred Binding • Create and select a specific implementation of a class • Either using Replacement or Generators
  12. 12. Solution #1: Workspace plugins (1) ‘mvn -Dconsole.profile=drools install’ (2) Properties file or annotations (3) Deferred Binding Generator
  13. 13. Limitation #1: Component interplay • Each plugin component isolated • No interplay possible • It would introduce dependencies • Grouping by functionality vs. usability • Conceptual split not necessarily technical split
  14. 14. Challenge #2: Interplay w/o dependencies • Model-View-Controller ? • Less coupled, but still dependency • Compile-time (1) Model changed (2) Update View
  15. 15. Solution #2: Pub/Sub • Messaging through publish / subscribe • Messaging API only shared dependency • Notion of “presence” (1) Publish messages (2) Subscribe Listener
  16. 16. Limitation #2: Pub/Sub • Decoupling through de-typed nature • No compile-time checking • Exchange protocol (contract) not “visible” • Choreography validation?
  17. 17. Challenge #3: Server side capabilities • Backend capabilities may change as well • Staging vs. production • Different product versions • Target runtime derivations • Remember: Compile-time linking AJAX is pure client side technology
  18. 18. Solution #3: Bootstrap • Bootstrap: “Give me a list of capabilities” • Usually RPC call when app starts • Problem: Fixed initialization point • Lazy Components? (1) Client UI starts, request server status (2) PluginInfo (type, available)
  19. 19. Solution #3: Messaging w. Presence • Presence: “Need a plumber. Please call XYZ” • Relies on messaging bus behind the scenes • Async, independent, durable (1) Client: Seek capability (2) Provider: Offer capability
  20. 20. Introducing Project Errai
  21. 21. Project Errai • Consolidates JBoss GWT efforts • Both R&D and actual product development • Work in progress • Best of breed spin-off as OSS • Errai-Bus, Errai-Workspace, Errai,Widgets • http://jboss.org/errai
  22. 22. Errai-Bus • Backbone to application design • Common architecture across client&server • Enables federated architecture • Asynchronous messaging (pub/sub) • Conversational • Both GWT and Javascript API (OpenHub Spec)
  23. 23. Errai-Bus API: Common to client & server (1) Client: Publish (2) Server: Subscribe • NOTE: Don’t confuse pub/sub roles with tiers • Scenarios: • client-client across server (chat server) • client-client w/o server (inter component) • client-server (client send) • server-client (server push)
  24. 24. Errai-Workspaces • UI environment for which to deploy your console • Develop against a common workspace API • Provides generic services • Authentication & Authorization • Logging & Exception handling • Presence (aka Shoutbox) • [...] (add your implementation here)
  25. 25. Workspaces API • Evolution of the property based config • Uses Deferred Binding as well (1) Annotation driven (2) Automatic workspace assembly
  26. 26. Errai Widgets • Complements OSS offering (i.e. Mosaic)
  27. 27. Putting it all together • Baseline and best practices • Free composition of console components • Different projects provide management tools • Mix and match with 3rd party elements
  28. 28. Demo Applications
  29. 29. Q&A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×