best practices for building large gwt applications
play

Best practices for building large GWT applications Heiko Braun - PowerPoint PPT Presentation

Best practices for building 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 SOA, BPM, GWT Contributor:


  1. Best practices for building large GWT applications Heiko Braun <hbraun@redhat.com>

  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 > http://jboss.org

  3. Topics • Decomposing a large GWT application • Introducing project Errai

  4. Decomposing a large GWT application

  5. Example: JBoss SOA tooling

  6. Challenge #1:Feature Set • Different features per: • Target runtime • Development stage • Project lifecycle • Target audience

  7. Solution #1: Compile-time composition • Uses Deferred Binding [1] and plugin discovery • Leverage Maven dependency sets • Defer decision which components go into application • Allows ‘divide and conquer’ approach [1] http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideDeferredBindingConcepts

  8. Solution #1: Compile-time composition

  9. Limitation #1: Component interplay • Each plugin component isolated • No interplay possible • It would introduce dependencies • Grouping by functionality vs. usability • Technical split vs. conceptual split (i.e process execution & reporting)

  10. Challenge #2: Coupling between components

  11. Challenge #2: Coupling between components • Components “decorate” functionality • i.e. Process Management & Reporting • Dependencies may come and go • Different feature set: - Maturity (Beta vs. Final) - Environment (staging vs. production) - Profiles (authorization roles)

  12. Solution #2: MVC • Model-View-Controller ? • Less coupled • Enables interplay between UI plugin components • Still compile-time dependencies (i.e controller to view)

  13. Solution #2: Pub/Sub • Messaging through publish / subscribe • Baseline on Messaging API • Single, shared dependency • Challenge: detyped, no contract

  14. Challenge #3: UI coupled to services • I.e. Report Tools (UI) requires BIRT Engine (backend) • Services may come and go: • SOA promise • Different product versions • Target runtime derivations

  15. Solution #3: Bootstrap • Bootstrap: “Give me a list of capabilities” • Performed when application starts • Problem: Fixed initialization point • Lazy Components?

  16. Solution #3: Blackboard • Presence: “I need a SMTP service. Notify me upon availability” • Relies on messaging bus behind the scenes • Async, independent, durable

  17. Lessons learned • All purpose solution: pub/sub • Async communication already preferred • Use it to: • Decouple UI components • Integrate backend services • Break the request/response paradigm

  18. Introducing Project Errai

  19. Project Errai • Tackles the problems described earlier • Consolidates JBoss GWT efforts • Both R&D and actual product development • Main components: • Message Bus & Workspace framework > http://jboss.org/errai

  20. Message Bus • Backbone to application design • Federated architecture • Asynchronous & bi- directional • Broadcasting & Conversations • Built-in serialization • Supports OpenHUB spec • HTTP + NIO

  21. Common, shared messaging API Publisher Subscriber

  22. Pub/Sub roles vs. tiers • Subscriber defines target tier: • client-server (client send) • server-client (server push) • client-client across server (browser to browser) • client-client w/o server (inter component)

  23. Workspace framework • UI environment for which to deploy your console • Provides development infrastructure, documentation and examples: - Tear down barriers, ease of use • Common, shared services, i.e: - Authentication & Authorization - Logging & Exception handling • Allows composition at various stages: - Sandbox, Project, Product

  24. Workspaces API • Handles loading, initialization and access of UI components • Uses maven dependencies, deferred Binding and auto-discovery (1) Component declaration (2) Workspace assembly

  25. Conclusion • Presented patterns are solutions to coarse grained problems • Also consider MVP , GIN, etc: See Google I/O • Message Bus has proven to be a good all-purpose solution • Next big thing: Bring GWT to the enterprise Java community - CDI integration ( Tuesday, 1 June 2010, 15:00-15:50, Arena 3 ), - JMS integration - Portal / OpenSocial gadgets

  26. Q&A > http://jboss.org/errai > http://errai-blog.blogspot.com/

Recommend


More recommend