What is difference between the mvc1 and mvc2 design pattern?

Showing Answers 1 - 16 of 16 Answers

Vinay Kumar S

  • Sep 28th, 2005
 

Hi Friends,

              If we used the MVC architecture for standalone applications ie called as MVC1 Architecture. If we coupled this MVC architecture for webapplications ie called as MVC2 architecture.

  Was this answer useful?  Yes

S.D.R.K

  • Oct 5th, 2005
 

Want to learn more

  Was this answer useful?  Yes

RajaShunmugam

  • Dec 4th, 2005
 

In MVC1 Request will going to JSP Page.But in MVC2 Request will go to Servlet.

  Was this answer useful?  Yes

rajkumar

  • Mar 1st, 2006
 

mvcpattern 1 which is model and view and controller

mvcpattern 2 which is model and view and controller

  Was this answer useful?  Yes

M L Srikanth

  • Apr 6th, 2006
 

While dealing with tiered implementation, there will be three major parts like view, data and business rules that can be imposed on data. While designing these types of implementations, we can develop two layers as follows,To produce view by processing data directly calling underlying model using beans and their functions and these functions will implement business rules.This is merely MVC1 model.But, in MVC2 model,View will be rendered by many of the view technologies like XML, HTML or other by using JSP ( Servlet 2.1 extension).All the requests from view will be captured through a controller which can be implemented with Servlets. This way, presentation seperated by model interfacing methodology.Model (data) can be designed and developed using application domian centric methodologies.

  Was this answer useful?  Yes

swarna

  • May 27th, 2006
 

In MVC1 the business Logic and presentation logic will be presented in the same page where as in the case of MVC2 the business logic and presentation logic will be seperated.

  Was this answer useful?  Yes

chandra_raya

  • Jul 12th, 2006
 

Hi,

MVC1 is the clear violation of Design Rules, i.e for communication between the layers is done through j only jsps,where as in MVC2 Servlet acts as a controller which in turn communicate with both presentation and database layer.

with regards

chandra

  Was this answer useful?  Yes

Mohammad Mustafeez

  • Jul 26th, 2006
 

A Model 1 architecture consists of a Web browser directly accessing Web-tier JSP pages. The JSP pages access Web-tier JavaBeans that represent the application model, and the next view to display (JSP page, servlet, HTML page, and so on) is determined either by hyperlinks selected in the source document or by request parameters. A Model 1 application control is decentralized, because the current page being displayed determines the next page to display. In addition, each JSP page or servlet processes its own inputs (parameters from GET or POST). In some Model 1 architectures, choosing the next page to display occurs in scriptlet code, but this usage is considered poor form. (See the design guideline Section 4.2.6.8 on page 89.)A Model 2 architecture introduces a controller servlet between the browser and the JSP pages or servlet content being delivered. The controller centralizes the logic for dispatching requests to the next view based on the request URL, input parameters, and application state. The controller also handles view selection, which decouples JSP pages and servlets from one another. Model 2 applications are easier to maintain and extend, because views do not refer to each other directly. The Model 2 controller servlet provides a single point of control for security and logging, and often encapsulates incoming data into a form usable by the back-end MVC model. For these reasons, the Model 2 architecture is recommended for most interactive applications

  Was this answer useful?  Yes

kynath

  • Sep 25th, 2006
 

Hello friends,relating to MVC1 and MVC2 plz see this site.It is damn good.http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

  Was this answer useful?  Yes

Nagaraj

  • Oct 5th, 2006
 

JSP Model1 refers to MVC1 and Model2 refers to MVC2.

Model1 is JSP page-centric and Model2 is controller-centric(Servlet/Struts) 

we can use servlet as the controller, but it can be replaced by struts and further more.... Streks(as of now, only beta version released)

  Was this answer useful?  Yes

Mvc1 no concept of controller, view directly interacts with model. This makes both view and model tightly coupled, thereby multiple view technologies are not leveraged. All three factors are opposite in Mvc2. Mvc2 controller concept is introduced, where it plays a centralized role. Controller is configured to spit any of the predefined view technologies to name HTML, XML, JSP, WML etc. Controller is also configured on the model it can interact with. Model represents business layer, so it could talk to any data model like business components (EJBs), JDBC to interact with any database or say Hibernate Webservices etc. All client requests are configured to land at controller, so it could check security, logging, session handling. Since servlet is best bet having these characteristics, servlet controller component is introduced in Struts.
Thank you.

  Was this answer useful?  Yes

Abdul Waheed

  • Jun 2nd, 2007
 

just let me explain that "MVC1" architecture got its name when traditional MVC was enhanced to MVC2 by implementing some advanced techs eg sruts, spring framework, or XForms.


The traditional MVC (MVC1) has Model in the form of classes (beans and connectivity of Databases). JSP pages as View part and for controller part one and only servlet.

Whereas in enhanced MVC (MVC2) the browser sends Request to the ActionServlet that Reads StrutsConfig.XML (these two are part of Controller) then it goes to Model part ( Data Classes and DataBase) according to request by browser. Here  ActionClass and ActionForm(Basically Beans or EJB) are embedded in view part and that give a response to View Part As Jsp Page to the Browser.

  Was this answer useful?  Yes

subhashis

  • Oct 7th, 2007
 

MVC1 architecture stands for model view and controller and MVC2 architecture is also stands for model view controller but the major difference is in MVC1 there is only one controller for one aplication and for that it is bulkier means it have to handel all the controller concept in other words the flow of the project, So there are some disadvantages in it like tracking bugs. So in MVC2 architecture they just split the controller to avoid the disadvantages of MVC1.

  Was this answer useful?  Yes

rasahere

  • Jul 8th, 2009
 

MVC1 was a first generation approach that used JSP pages and the JavaBeans component architecture to implement the MVC architecture for the Web. HTTP 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.

MVC2 is a an MVC architecture for Web-based applications in which HTTP requests are passed from the client to a “Controller” servlet which updates the “Model” and then invokes the appropriate “View” renderer-for example, JSP technology, which in turn renders the View from the updated Model.

The hallmark of the MVC2 approach is the separation of Controller code from
content. (Implementations of presentation frameworks such as Struts, adhere to the MVC2 approach).

  Was this answer useful?  Yes

Main difference is:
in MVC1 design pattern view and controller elements are implemented using servlets.
in MVC2 design pattern view is implemented using JSP and controller is implemented using servlets.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions