Rich Client Implementation Patterns Ürgo Ringo Aqris Software
Complexity Classical web app client Rich client
<ul><li>Rich clients have more state  </li></ul>AMS2.0 Model for week view
GUI complexity boosters <ul><li>Distribution of business domain code among client and server
Remote IO
Custom widgets
UI state synchronization </li></ul>
MVC(1) <ul><li>Model </li><ul><li>is the application without UI
contains all application state
may communicate with DB or server </li></ul><li>View
Controller </li><ul><li>adapts events from View to Model API
doesn't contain any business logic </li></ul></ul>
MVC(2) <ul><li>+ Model is separated
+ Controller can be testable
- Controller and View are tightly coupled
Upcoming SlideShare
Loading in …5
×

RIA implementation patterns

1,475 views

Published on

Published in: Technology
  • Be the first to comment

RIA implementation patterns

  1. 1. Rich Client Implementation Patterns Ürgo Ringo Aqris Software
  2. 2. Complexity Classical web app client Rich client
  3. 3. <ul><li>Rich clients have more state </li></ul>AMS2.0 Model for week view
  4. 4. GUI complexity boosters <ul><li>Distribution of business domain code among client and server
  5. 5. Remote IO
  6. 6. Custom widgets
  7. 7. UI state synchronization </li></ul>
  8. 8. MVC(1) <ul><li>Model </li><ul><li>is the application without UI
  9. 9. contains all application state
  10. 10. may communicate with DB or server </li></ul><li>View
  11. 11. Controller </li><ul><li>adapts events from View to Model API
  12. 12. doesn't contain any business logic </li></ul></ul>
  13. 13. MVC(2) <ul><li>+ Model is separated
  14. 14. + Controller can be testable
  15. 15. - Controller and View are tightly coupled
  16. 16. - View update logic cannot be tested </li></ul>
  17. 17. Model-View-Presenter with Supervising Controller <ul><li>+ Complex View update logic is testable
  18. 18. - View and Controller even more coupled </li></ul>
  19. 19. MVP with Passive View <ul><li>+ Even more View update logic is testable
  20. 20. - Controller is even more coupled to View </li></ul>
  21. 21. Presentation Model <ul><li>+ View update logic is testable
  22. 22. + Controller can be testable
  23. 23. - Model has more knowledge about UI </li></ul>
  24. 24. Distribution of complexity
  25. 25. Command <ul><li>each user request is handled by separate command
  26. 26. used in Swing and SWT </li></ul><ul><li>+OO
  27. 27. + support for undo/redo
  28. 28. - can result in many small classes </li></ul>Relationship to MVC?
  29. 29. Various if (RoleManager. getCurrentRole ().equals(Role. PROJECT_OWNER )) { button.setEnabled( true ); } else { button.setEnabled( false ); } AuthorizationManager. prepare (button, Role. PROJECT_OWNER ); <ul><li>Adaption </li></ul><ul><li>Widget assembly </li></ul>panel.add( new OkCancelPanel()); panel.add(Factory. createOkCancelPanel ()); panel.add(Builder. create ( &quot;btn:ok, btn:cancel&quot; )); <ul><li>Composable units </li></ul><ul><li>e.g EnterActivity MVC, ProjectViewPanel, TeamViewPanel </li></ul>
  30. 30. Swing <ul><li>View and Controller merged into one component
  31. 31. Look-and-feel handled by separate UI delegate
  32. 32. Types of Models </li><ul><li>GUI state (e.g ButtonModel, TreeSelectionModel)
  33. 33. application state (e.g ListModel, TableModel)
  34. 34. mixed (e.g ButtonModel if used for JCheckBox) </li></ul><li>Uses Actions (commands) </li></ul>public interface ActionListener extends EventListener { public void actionPerformed(ActionEvent e); }
  35. 35. Eclipse RCP <ul><li>Workbench </li><ul><li>e.g Windows, Editors, Perspectives </li></ul><li>JFace </li><ul><li>e.g Viewers, Dialogs, Wizards </li></ul><li>SWT </li><ul><li>e.g Buttons, Trees, Lists, Tables </li></ul></ul>
  36. 36. Resources <ul>Source code http://www.aqris.com/x/SgC Recommended reading http://www.kriso.ee/Professional-Java-User-Interfaces/db/9780471486961.html Photo credits yushimoto_02 @flickr: http://www.flickr.com/photos/yushimoto_02/3419855883/sizes/l/ </ul>

×