What is the actual difference between MVC and MVC Model2

Showing Answers 1 - 20 of 20 Answers

swaroop

  • Oct 18th, 2005
 

MVC1, is architecture which does not include struts frame work in it, whereas in case of MVC2 it includes struts frame work.MVC1 is called model1 and MVC2 is called model2.

  Was this answer useful?  Yes

pradeep

  • Oct 20th, 2005
 

swaroop Wrote:

MVC1, is architecture which does not include struts frame work in it, whereas in case of MVC2 it includes struts frame work.MVC1 is called model1 and MVC2 is called model2.


1)In MVC1 architecture only one controller is responsible for both business logic and to send control for the other model components.

Where as in MVC2 the business logic is seperated from control components.And only one controller is responsible for taking all the requests and responses.And servlet acts as a controller.

  Was this answer useful?  Yes

praveen kumar

  • Oct 30th, 2005
 

What is the actual difference between MVC and MVC...

  Was this answer useful?  Yes

prabhaker

  • Oct 31st, 2005
 

mvc is dicided that our middle tier architecture should divide in three parts like model,view and controller.But it does't know what are those components.

Where as model2 arch tells that model is Ejb/java bean,view is jsp,controller is servlet.

  Was this answer useful?  Yes

prabhaker

  • Oct 31st, 2005
 

swaroop Wrote:

MVC1, is architecture which does not include struts frame work in it, whereas in case of MVC2 it includes struts frame work.MVC1 is called model1 and MVC2 is called model2.

 

Hello swaroop i think u ridea is well,but untill now there is no mvc1&mvc2 Architectures,we have only mvc architecture.

To existing struts framework in more cofortable our sun provided the model1 & model2 arch.only only the diff is in model1 Arch controller is Jsp where as in model2 controller is servlets. 


  Was this answer useful?  Yes

Karthik

  • Nov 1st, 2005
 

MVC1 - There  will one dedicated controller which will interact with model and produces the view

MVC2- There will be a centralized controller which delegates the request to specific (Action) controller. The action controller interacts with model and produces the view. There are 2 controller in MVC2, this is the major difference

  Was this answer useful?  Yes

Hari Krishna .P

  • Nov 19th, 2005
 

 MVC is an architecture.

It divides the entire application into 3 layers based on the roles they are performing.

MVC1: in this, business logic and control logic is mixed

MVC2: cotrol logic is seperated from business logic

Servlets can be used for control logic

java Classes can be used for business logic

  Was this answer useful?  Yes

Praveen Siva

  • Dec 6th, 2005
 

In MVC1 there is no clear seperation of view and controller,I mean the jsp could be used as view or controller and at the same time even servlet could be used as view or controller.

But in MVCII , jsp can be used only for view and servlet can be used only for Controller

  Was this answer useful?  Yes

Raja Sekhar Reddy T

  • Dec 20th, 2005
 

Actual difference between MVC1 and MVC21)MVC1 IS JSP PAGE CENTRIC THAT ,EANS JSP ACT AS A CONTROLLER.Suppose 50 jsp files are hyperlinked through Mian JSP Page this situation accessing the jsp pages is depnd on the Main jsp page and Jsp page responsibilty is presentation and controller .Peformence point of view this is lagging.presentation layer and model both are combined.2)Another major difference is if u change any modifications in the presentation layer that is also effect on bussiness layer.overcome these drawbacks we go for MVC21)In MVC2 we invent controller is servlet.2)we can divisde whole application in to 3 parts MODEL---Java Beans,Session BEANS,Java Classes VIEW-JSP Controller---Servllets

  Was this answer useful?  Yes

Raj Pagare

  • Dec 24th, 2005
 

Hi Guys,

The "actual" diffrence between MVC and Model 2 is that in MVC, if the model state changes then it can directly notify the view using the observer pattern.The figure of MVC shows a loop with Model,view and Controller all linked to each other. Wheras in Model 2 in addition to defining JSP for view and Servlets for controll, the association is also defined, the association is "flatter" i.e. the view can only talk to controller and model also can only talk to controller. Model can not directly talk to view.

 Model 2       

View<->Controller<->Model

MVC

                      Controller

                     /            \

             Model <------> View                                      

                                                                  

       /

           

  Was this answer useful?  Yes

test

  • Feb 15th, 2006
 

MVC is an architecture.

It divides the entire application into 3 layers based on the roles they are performing.

MVC1: in this, business logic and control logic is mixed

MVC2: cotrol logic is seperated from business logic

Servlets can be used for control logic

  Was this answer useful?  Yes

siva kumar reddy

  • Aug 3rd, 2006
 

hi

Struts is included in mvc2 arachitecture. In mvc2 controller is seperated

in mvc1 architecture jsp act as view component as well as a controller also

in mvc2 architecture jsp act as a view coponent only, controller components in struts are ActonServlet and action classes.

cheers

siva

  Was this answer useful?  Yes

P.J.V.GPRAKASA RAO

  • Aug 8th, 2006
 

u r absolutely correct

  Was this answer useful?  Yes

BalaMurali J

  • Dec 7th, 2006
 

MVC1-JSP act  as both controller and View.  But MVC2-The Servlet act as a controller, JSP act as a view.

  Was this answer useful?  Yes

Arvind

  • Jan 17th, 2007
 

Hey!

PLz don't confuse things.

Remember--> there is Model1  and Model2  designs, OK, but no MVC1 and MVC2, only MVC.

Model1----> where each request is catered by a servlet/JSP, whatever, and from there onwards links to the business logic and data part. like we had systems earlier when servlets were couple of years old.

request1--->servlet1--->someServiceClass1---->dataPart1---->DB

request2---->servlet2---someServiceClass(1 or 2)----datapart2--->DB

slowly this evolved with one controller, common service, common data connection part and separate query part.

MVC( model2 included ) I think u know all this:

request1--->servlet1(actionservlet)--->someActionClass1---->ServiceLocator---->dataPart1---->DB

request2---->servlet1(actionservlet)--->someActionClass2---->ServiceLocator---->datapart2--->DB

  Was this answer useful?  Yes

upendra_kumar2001

  • May 29th, 2007
 

In MVC1 the request is made on web browser and all the processing like any data validation, request processing is done in the single place. So writing and maintaining the code in the MVC1 is very difficult.

Where as in case of MVC2 it distinguishes the different layer and each layer is responsible for its own work. as in MVC the three well known layers are Model, View and Controller. So if we require to change the code then it is easy to locate the code, where we r require to make changes.

Hope u will enjoy this solution....HAVE A FUN...

  Was this answer useful?  Yes

dsmanyam

  • Jul 29th, 2007
 

I think Karthik is right. In the MVC-1 architecture there was only one controller involved to process a request from the initial stage to the final stage, whereas in the MVC-2 architecture the controller has been split into 2 where the action controller has another component called the ReqeuestProcessor which handles how the request is to be processed. This gives better flexibility in a multi-moduled application where the request is to be sent to different action handlers based on the module thats to be invoked.

  Was this answer useful?  Yes

ashishin

  • May 12th, 2008
 

Hi,MVC is a design pattern. It contains two models. MVC Model1, MVC Model2 .Struts framework implements MVC Design Pattern. Struts can implement Model 1 and Model 2. Model 2 most properly describes the application of MVC in a Web-Application context.Following are the important feature of MVC1 architecture: (1) HTML or JSP files are used to code the presentation. JSP files use java beans to retrieve data if required.(2)MVC1 architecture is page-centric design all the business and processing logic means any JSP page can either present in the JSP or may be called directly from the JSP page.(3)Data access is usually done using Custom tag or through java bean call.Therefore we can say that in MVC1 there is tight coupling between page and model.Following are the important feature of MVC2 architecture(1)This architecture removes the page-centric property of MVC1 architecture by separating Presentation, Control logic and Application state(2)In MVC2 architecture there is one Controller which receive all request for the application and is responsible for taking appropriate action in response to each request. Second one is Model which is represented by JavaBeans, business object, and database. Third one is View or is JSP page it takes the information provided by Controller and Module and presents it to user

  Was this answer useful?  Yes

MVC1
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. 
MVC2
                                             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.

  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