This shows you the differences between two versions of the page.
when_using_dci_with_mvc_is_it_ok_to_let_views_and_controllers_play_roles_in_a_context [2014/01/19 23:04] (current)
|Line 1:||Line 1:|
|+||====== When using DCI with MVC, is it ok to let Views and Controllers play Roles in a Context? ======|
|+||A View is an object, so a View can play a Role. RoleMethods could actually update the View, this is more direct than using the observer pattern, for example.|
|+||Since Controllers are objects too, naturally they can play a Role as well. This could be useful if the Controller has some state that will change its behavior, for example [[http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.modelstate(v=vs.118).aspx|Controller.ModelState]] in ASP.NET MVC.|