MVC Design Pattern to Combine Multiple Models for use
- by roverred
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.