UI Application Block 2.0 : Deciding the number of Controllers RRS feed

  • Question

  • User-211015764 posted
    Hello All, How to determine number of contollers to use? At a minimum you should have One Controller per Navigation Graph given the fact that the constructor for your controller class must accept the navigator you are using as a parameter. Is the above statement correct? Another debate we are having is should you have one Controller for each View or can one Controller be shared across multiple Views. Just because you can do something does not make it correct. Therefore, which is proper design and why? One Controller per One View or One Controller for Multiple Views, where multiple views are of the same type all WinForms and each view has different data items for the same Use Case. Anyone who has used UIPAB 2.0... please help TIA
    Tuesday, February 8, 2005 3:09 PM

All replies

  • User1048034812 posted
    Hi Kumzy, It should be one Controller for multiple Views. But you can have multiple Controllers for different use cases. E.g. an application has 2 top level use case: 1. Accounts management (view/add/update/delete accounts). 2. Bills management (view/add/update/delete bills). There will be 2 Controllers with their respective Views as follows: 1. AccountsMgmtController. - ViewAccount.aspx - AddAccount.aspx - UpdateAccount.aspx - DeleteAccount.aspx 2. BillsMgmtController - ViewBills.aspx - AddBill.aspx - UpdateBill.aspx - DeleteBill.aspx Hope this clarifies things a little.
    Monday, February 14, 2005 9:56 PM