1

I am new to using MVC in an object oriented context. Other questions on this topic failed to answer controller specific questions.

My idea of MVC is controllers hold their associated views, (using the observer design pattern the controller listens to action events in the view). However im my application in my initial 'start up menu view' the controller listens and handles 'register' and 'login' events. I also have a button called 'Quick build' which bypasses register and login. This 'quick build' button fires an event to use a DIFFERENT controller/view. The logical solution would be to instantiate the new controller and display its view as the event when the button is pushed. However it seems more MVC like to have my second controller listen to the first which would require it to be already instantiated. In that case i would instantiate all controllers in the main method and pass their listeners (including my second controller listening to the first for the 'quick build' event.)

Does any of this even matter!? Or am I thinking way too deeply into this? I ask this because im not sure of how rigid the MVC architecture needs to be.

PS all OOP(Object Orientated Programming) MVC tutorials I have seen are basic and don't demonstrate how to handle more than 1 controller so I haven't been able to find this information myself. This question and its answers will be beneficial to beginner software developers who want to understand high level concepts of MVC in a OOP contect

4

0 回答 0