What is the difference between mvc1 and mvc2?
2 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Wednesday, October 29, 2003 05:15 AM

what is MVC1 and MVC2?

Re:Difference between MVC1 and MVC2?

Posted By:   r_s  
Posted On:   Thursday, October 30, 2003 02:14 AM


In MVC-1 architecture (also referred as Model 1), the request is first handled by a JSP, that interacts with a Bean. Here the JSP page may have partial processing logic, although a bulk of processing logic may be handled by the beans that may interact with the database. The JSP in this case in addition to being responsible for 'View' of MVC also takes the resposibility as 'Controller', and the beans acting as Model. For small applications that do not have complex processing, this model may be fine, but in case of bigger applications where a lot of processing and decision making is required (Authentication, Logging, Conditional redirection, database interactions, network connections) this is not the best option.

In such cases MVC2 or Model 2 architecture is the better option. It has a Controller Servlet that handles all the incoming requests (You may refer to the Front Controller pattern) and acts as the 'Controller', it determines what comes next, a View (JSP) or further processing by Model (Beans doing all the complex tasks), and will decide the view to display the results from the Model.

The links on the JSP pages for next view may also pass through the controller servlet to determine the next view, unlike in MVC-1 where the links on a JSP page will directly point to another JSP page.


Re: What is the difference between mvc1 and mvc2?

Posted By:   Steve_Daskam  
Posted On:   Wednesday, October 29, 2003 08:09 AM

Basically, the difference is with the Model 1 architecture, you just use JSPs and maybe some java beans, but it's not a true MVC architecture. With Model 2 architecture, you use the MVC construct with Java Beans as the Model, JSP pages as the View, and Servlets as Controllers.

Check out this link for more detail:




About | Sitemap | Contact