Let's say I have two objects, A and B, both with a model, view and a controller. The user is in the view for A, then presses a button or something that calls an action in the A controller. This action requires some use of the B model. From the action in the A controller, am I supposed to call directly to the B model, or should I be going through the B controller to interact with the B model? Thanks for reading.
A:
I guess you should go through the B controller as B controller has access to B model.
happyhardik
2010-09-07 06:25:27
What do you mean, "only has access?" There's no reason it HAS to be that way.
Matt Olenik
2010-09-07 06:30:28
You "guess"? Is that how you code, by guessing?
RPM1984
2010-09-07 06:38:44
oops! removed the word "only".
happyhardik
2010-09-07 06:39:39
+1
A:
You can have a ViewModel pattern see this http://stackoverflow.com/questions/1361092/asp-net-mvc-viewmodel-pattern
ajay_whiz
2010-09-07 06:30:07