In my design, I have multiple models and each model has a controller. I need to use all the models to process some operation. Most examples I see are pretty simple with 1 view, 1 controller, and 1 model. How would you get all these models together?

Only ways I can think of are

1) Have a top-level controller which has a reference to every controller. Those controllers will have a getter/setter function for their model.

Does this violate MVC because every controller should have a model?

2) Have an Intermediate class to combine every model into a one model. Then you create a controller for that new super model.

Do you know of any better ideas? Thanks.


MVC is better viewed as a logical rather than physical construct.

You are free to create a model out of other models or take the repository (if you have one) in its entirety as the model if you need to. Some frameworks for example promote the use of viewmodels for such purposes when you wish to create a single model that is consumed by the view.

Likewise in the view, you can create multiple views based on the viewmodel. Whilst the code for this may sit in one physical view, logically they are different.

If you find yourself passing round the same model for everything, this might indicate that you have a god object which is obviously best avoided.


You started from the wrong idea that there is a one-to-one relation between controllers and models in MVC. There is no such requirement. In fact, an MVC controller should use as many classes from the MVC model as it needs to perform its operations.


In MVC, Model View and Controller are independent modules. The Controller have ultimate power to determine which Model has to be sent to View to serve the request.

protected by gnat Aug 5 '16 at 17:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.