MVC - Calling Controller Methods

Posted by JT703 on Stack Overflow See other posts from Stack Overflow or by JT703
Published on 2010-05-26T14:26:47Z Indexed on 2010/05/26 14:41 UTC
Read the original article Hit count: 446

Filed under:
|
|
|

Hello,

My application is following the MVC design pattern. The problem I keep running into is needing to call methods inside a Controller class from outside that Controller class (ex. A View class wants to call a Controller method, or a Manager class wants to call a Controller method). Is calling Controller methods in this way allowed in MVC? If it's allowed, what's the proper way to do it?

According to the version of MVC that I am following (there seems to be so many different versions out there), the View knows of the Model, and the Controller knows of the View. Doing it this way, I can't access the controller. Here's the best site I've found and the one describing the version of MVC I'm following: http://leepoint.net/notes-java/GUI/structure/40mvc.html. The Main Program code block really shows how this works.

Thanks for any answers.

© Stack Overflow or respective owner

Related posts about mvc

Related posts about view