Tags: , , | Categories: .net, asp.net mvc Posted by balazs.zoltan on 7/10/2010 7:38 PM | Comments (0)

Some of the MVC mantras:

  • Keep models fat, controllers skinnyimages
  • Keep as much business logic in the models as possible
  • Models should not talk to view

Controller stinks if:

  • The controller services too many requests (i.e. has too many actions)
  • The controller has domain logic (i.e. model code has crept into the controller)

What a controller should not do:

  • Bind post data to view models – use model binders for this
  • Calculate something (domain logic) – view models or entities should do this
  • Validation – best if view model validation is handled automatically (using binders)