I am writing an application using a composite MVC pattern. Model includes through composition the class User . There is a need to View when you click on the JTree element (object) in the table next to display data associated with this category (set). Is it possible in this case to directly access the User object from the View to display the data, or is it necessary to do everything exclusively through the controller and model?

    1 answer 1

    In the original version of the MVC pattern, where external signals accept the representation, the model can be accessed from the representation, in the Model 2 variant that is commonly used for the Web and where the external signals are received by the controller, the model reference from the representation is considered a gross violation of the pattern.