Quote:
Originally Posted by smani hi,
I am not sure of MVC2 architech, can anyone explain about that,
any referance article available.. since i didn't find any resource!
Thanks in advance
Regards
Manivannan |
hi
i ll explain u about MVC2 clearly by referring MVC1
MVC1 was a first generation approach that used JSP pages and the JavaBeans component
architecture to implement the MVC architecture for the Web.
Requests are sent to a JSP page that implements Controller logic and calls out to the “Model” for data to update the “View.” This approach combines Controller and View functionality within a JSP page and therefore breaks the MVC paradigm. MVC1 is appropriate for simple development and prototyping. It is not, however, recommended for serious development.
The MVC2 architecture is actually a modified MVC implementation. The major modification is that the Model no longer fires events to its Views.
The central issue is that the life cycle of the servlet (the Controller and View) is not necessarily the life cycle of the application, as it is with desktop applications. The servlet begins with a user request, typically generated by a Web browser, and ends with the response. The Model, however, may, and typically does, persist across the life of multiple servlets. Therefore, it cannot reliably notify View objects of internal state changes.
This has the following consequences:
The Model is now more “generic,” because it no longer implements the logic for
registering and unregistering listeners, nor does it need to implement logic to generate
events.
The View is now responsible for capturing Model state changes.
The Controller now notifies the View of state changes to the Model.
The Controller must manipulate the Model before notifying the View.