0

According to the MVC model, is it safe and "correct" to pass controller through mainFrame to subclasses?
I try to implement certain functions(like save file, open file) and I so far I had them inside mainFrame class of a program which is so far the only class having access to the controller.
Now I decided to use Command Strategy Pattern but I'd have to pass the controller as a parameter to the subclass to use it(Controller it's used to access model and save object).

lucaskos
  • 67
  • 9
  • Look also at Mediator pattern. Wiki has example similar to your situation https://en.wikipedia.org/wiki/Mediator_pattern – WyMuT_CoCHa Jan 13 '17 at 20:12
  • More [here](http://stackoverflow.com/q/25502552/230513). – trashgod Jan 13 '17 at 21:06
  • Yes and no, this might result in a god controller which isn't what you want, so instead, you might have a number of child controllers (which could reference the main controller as required), as an idea – MadProgrammer Jan 13 '17 at 21:20

0 Answers0