What is diff. between MVC1 and MVC2?

Showing Answers 1 - 8 of 8 Answers

ramanaj2ee

  • Aug 31st, 2006
 

Model1:

In model1 we have only one controller either jsp/servlet for receiving request,validate the data,populatedata,prepare responce and send back to client.Here no reusable code.

Model2 or MVC:

In model2 we implement 3 components model,view,controller.The controller is jsp/servlet to hhandle request and send to Model.The model is either pojo/DAO/EJB.The model interact with database and results send back to controller then it sends to View meand JSP.From this view can send responce back to client.Here the persistance and bussiness logic will be reused.It avoids code duplication.

  Was this answer useful?  Yes

bani

  • Sep 1st, 2006
 

hi,from my reading knowledge,No MVC1 & MVC2. Its only model1 & model2.Model2 became later to MVC pattern.so the diff between Model 1 & 2 is thatModel1 doesn't provide any controller. so we are the only responsible to write entire flow of the control . Model 2 which provide a controller for that to recieve a request and send a response in client/server model .

  Was this answer useful?  Yes

PrasoonSrivastava

  • Sep 2nd, 2006
 

Here two type of model for web development1: model 1 2:model 2model 1 In model 1 architechture only one page is responosible for all operation's.presentation,control,validation,request hanling n responding back client..it was so clumsy method.so model 2 architechture came in to the existence.Model 2: in this model web application can be devide into three layers or components:1 model: which hold's business logics can b in database model is build wid the help of EJB/ADO.it interact wid the database n sent bac the responces to controller.2:view : it is the presentation layer.can be written wid the help of HTML/DHTML/JSP.3:controler: it control the overall process which is requested by the user.n it is responsible to responding to the client.its written in servlet. THE ADVANTAGE OF MODEL 2 OVER MODEL 1 IS THAT THESE CODES R REUSABLE N IT AOIDES DUPLICASY.

  Was this answer useful?  Yes

bhupathi reddy

  • Sep 4th, 2006
 

hi,here first go throuth bani and ramana's comments,that are correct but i am giving my explaination, If struts follows MVC2 architecture, loose coupling is possible (This loose coupling means that many changes can be made without modifying or recompiling Javacode, and that wholesale changes can be made by editing a single file.) and different components can perform diff. tasks that can be performed by diff developers,that makes easy.  But in MVC1,that loose coupling is not possible. 

  Was this answer useful?  Yes

Srinivas

  • Sep 4th, 2006
 

   MVC is generlised architecture. There is no MVC1 and MVC2. According to Sun Microsystems in MVC Model1 driven architecture Controller and view is JSP and model is bean. In MVC model2 driven architecture we will use Servlet as controller, JSP as view and Bean as Model.

MVC1:-----In case of MVC1 Jsp is used as both view and controller.And JavaBean is used as Model i.e to persist the data into database Controller--->JSP View --->JSP Model --->JavaBeanMVC2:-----Where as in MVC2 architecture for Conroller---->Servlet View ---->Jsp Model ---->JavaBean

  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