Need suggesion on design pattern RRS feed

  • Question

  • Hi ALL,

    I am designing MVC based application, I am looking for implementing design pattern which best suits my requirment but i do not know how can i model my design My requiremtns are as described below.

    Parameterisation module
                        Benefit Setup
                        Product setup 
                        contract setup
    Benefit setup has different sections so as product and contract setup

    Person configuration
    Limit configuration
    Cost value configuration etc....

    I am using Role based access control. and MVC based architecture access on controllers can be configured and there are different actions like save and validate in Person configuration section when person configration happens we call web services for oprations like validation.

    Please suggest me some solution to model this kind of application in MVC based architecture. Any help is appreciated in advance.
    Tuesday, January 18, 2011 8:30 PM

All replies

  • Usually, a controller per business entity is created, and when there is not enough operations on entities to create a controller, operations are group by domain, and a controller is created.

    Also, authorization could be directly integrated in MVC, check out http://davidhayden.com/blog/dave/archive/2009/04/09/CustomAuthorizationASPNETMVCFrameworkAuthorizeAttribute.aspx


    Thursday, February 3, 2011 2:38 PM
  • I think it depends (as always) on the type of UI you are creating. If you don't believe in sub-controllers and you want a page that aggregates views together then the controller would be more about the UI (or View Model) than the underlying entities. E.g. person UI may display the UI for the person entity and address entity, so the PersonConfiguration controller might be in charge of rendering two parital views, PersonEdit and AddressEdit. If you like the idea of sub-controllers and/or you only want a page per entity then yes you can have a controller per entity. Personally I would assume that I'd always want a View Model of the entity rather than the entity itself. Sometimes, especially for smaller systems, it seems like duplication of code but I find it helps maintain the separation of UI and business layers.
    Monday, February 14, 2011 1:08 PM
  • Have you evaluated why you need MVC. Ideally MVP suits more in ASP.Net rather then MVC. Please make sure supporting business case is well established before choosing any design patterns
    Friday, February 18, 2011 10:30 PM
  • Im sorry I have to strongly disagree that MVP suits ASP.net, IMO it's abs. the wrong choice. Sure it's possible (http://msdn.microsoft.com/en-us/magazine/dd252940.aspx) but you suffer from having to reconstruct the view to deal with commands which is eactly why web forms is a poor performance choice.
    Saturday, February 19, 2011 10:36 AM