Rich Client Design Patterns ( Prior to MVVM)

Patterns employed:

 
Model-View-Presenter Pattern
Application Controller Pattern

 
  1. Each view (Form and User Control) have its own Presenter
  2. Each view implement a specific public Interface, everything else is private
  3. Presenter interact with its view via Interface
  4. View  communicate with its Presenter via its own property, delegates, events (*)
  5. View does not know its Presenter, not even interface of the Presenter (*)
  6. Views are named based on their functionality instead of where they are used in the certain specific business process
  7. Presenters are named after its respective view.
  8. Only following logic should be In the code behind of the views:
    1. Data binding between UI elements and properties defined in the interface ( forward binding, reverse binding)
    2. Propagate events to notify its presenter
    3. Invoke public delegates set by its presenter
  9. Each presenter implements a specific public Interface, everything else is private
  10. A View plus its Presenter makes a functional unit
  11. There is no interaction among  functional units
  12. There is one Application Controller for each Business Process (License Renewal, Title Registration…)
  13. Presenter is not aware of which Application Controller it is in.
  14. Application Controller maintains the state of the business process throughout the life of the business process.
  15. Application controller interacts with its presenters via their public interfaces.
  16. Application controller Interact with the service layer (in process or throw proxy) to persist business mode data.
  17. The Service Contracts used by WCF Server side are used as Service Interface
  18. Service layer implement the Service Contract via Channel Programming. By doing this, the developer could bypass WCF layer directly hooks up Application Controllers to the BPC layer in process for debugging or unit testing.  
  19. Application Controller manages navigation logic of the business process.
  20. Application Controller instantiates and manages functional units to complete the business process.
  21. Application Controller communicate with functional units through the public the interface of their Presenter
  22. Entity object model is used as type for properties in View and Presenter as Model passing business data among different layers. 
  23. The application starts with a special Application controller, call Boot Strap
  24. Boot Strap instantiates a MDI form , Commands and menu items
  25. Response to the menu item the user selected, a specific command will be invoked.
  26. The Command will instantiates a specific Application Controller and Application controller will manage the business process from begin to its completion
 

 

 

 
With Unity Application Block, we can easily implement dependent injection for all required Interfaces.

 
If you are interested at Unity Application Block, this is the link http://unity.codeplex.com/

No comments:

Post a Comment