I do not believe that it belongs to the controller, because when it is built in there, it cannot exit.
I think that MVC should have another layer that is introduced between them: the service level, which is displayed when used. It contains business logic, knows about units of work and transactions, and deals with model objects and persistence to perform its tasks.
The controller has a link to the service, which should fulfill its use case. He takes care of decoupling requests for objects that the service can work with, calls the service, and sends a response to send back to the view.
With this arrangement, the service can be used on its own, even without a pair of controllers / views. This can be a local or remote object, packaged and deployed in any way that the controller deals with.
The controller is now more closely associated with the view. In the end, the controller that you will use for the desktop is likely to be different from the one used for the web application.
I think this design is more service oriented.
duffymo Feb 10 '09 at 21:25 2009-02-10 21:25
source share