RIA implementation patterns


Published on

Published in: Technology
1 Like
  • Be the first to comment

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

No notes for slide
  • JavaScript is not included in picture of classical web app client Web apps have smaller UI state User can trigger less events Web apps can be less responsive
  • Roughly equal testability as Passive View
  • All state is in Models – even GUI specific state.
  • JFaces – provides microarchitecture for complex, often-used widgets such as Trees and Tables. Contains model-driven widgets. Covers areas of UI development that developers encounter over and over, and it provides a clean way to accomplish those tasks. JFace depends on SWT, but it doesn't hide SWT widgets. For example, JFace viewers, which are model-based content adapters for SWT widgets, provide methods to access the underlying SWT widgets. This duality provides developers with the separation and ability to choose between model-driven UI development and raw widget manipulation. http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/guide/jface.htm
  • 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>