User Tools

Site Tools


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 Controller.ModelState in ASP.NET MVC.

when_using_dci_with_mvc_is_it_ok_to_let_views_and_controllers_play_roles_in_a_context.txt · Last modified: 2014/01/19 23:04 by gazoot