Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does MVC define how one controller should communicate with another?

I am referring to the general MVC design pattern (as defined in Wikipedia). When doing a GUI-intensive application, I would generally have many controllers, and sometimes a controller could send an event to another controller.

Does MVC in general defines how controller should communicate with controller? Could a controller be the model for a controller higher up in the hierarchy?

Example Suppose I have a window (which is represented by a controller/model/view), and that window is capable of launching another sub-window. The sub-window is modal, and will accept certain input. The input will affect certain processes in the main window.

like image 539
Extrakun Avatar asked Nov 05 '22 10:11

Extrakun


1 Answers

No. You can not do that with MVC. You want to use some kind of hierarchical pattern like one of the following two:

  • PAC
  • HMVC
like image 112
jgauffin Avatar answered Nov 26 '22 02:11

jgauffin