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

best practices for building large gwt applications
SMART_READER_LITE
LIVE PREVIEW

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:


slide-1
SLIDE 1

Best practices for building large GWT applications

Heiko Braun <hbraun@redhat.com>

slide-2
SLIDE 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

slide-3
SLIDE 3

Topics

  • Decomposing a large GWT application
  • Introducing project Errai
slide-4
SLIDE 4

Decomposing a large GWT application

slide-5
SLIDE 5

Example: JBoss SOA tooling

slide-6
SLIDE 6

Challenge #1:Feature Set

  • Different features per:
  • Target runtime
  • Development stage
  • Project lifecycle
  • Target audience
slide-7
SLIDE 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

slide-8
SLIDE 8

Solution #1: Compile-time composition

slide-9
SLIDE 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)

slide-10
SLIDE 10

Challenge #2: Coupling between components

slide-11
SLIDE 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)
slide-12
SLIDE 12

Solution #2: MVC

  • Model-View-Controller ?
  • Less coupled
  • Enables interplay between UI plugin

components

  • Still compile-time dependencies

(i.e controller to view)

slide-13
SLIDE 13

Solution #2: Pub/Sub

  • Messaging through publish /

subscribe

  • Baseline on Messaging API
  • Single, shared dependency
  • Challenge: detyped, no contract
slide-14
SLIDE 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
slide-15
SLIDE 15
  • Bootstrap: “Give me a list of

capabilities”

  • Performed when application starts
  • Problem: Fixed initialization point
  • Lazy Components?

Solution #3: Bootstrap

slide-16
SLIDE 16
  • Presence: “I need a SMTP service.

Notify me upon availability”

  • Relies on messaging bus behind the

scenes

  • Async, independent, durable

Solution #3: Blackboard

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

Lessons learned

slide-18
SLIDE 18

Introducing Project Errai

slide-19
SLIDE 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

slide-20
SLIDE 20

Message Bus

  • Backbone to application

design

  • Federated architecture
  • Asynchronous & bi-

directional

  • Broadcasting &

Conversations

  • Built-in serialization
  • Supports OpenHUB spec
  • HTTP + NIO
slide-21
SLIDE 21

Common, shared messaging API

Publisher Subscriber

slide-22
SLIDE 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)
slide-23
SLIDE 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
slide-24
SLIDE 24

Workspaces API

(1) Component declaration

  • Handles loading, initialization and access of UI components
  • Uses maven dependencies, deferred Binding and auto-discovery

(2) Workspace assembly

slide-25
SLIDE 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
slide-26
SLIDE 26

Q&A

> http://jboss.org/errai > http://errai-blog.blogspot.com/