What is the difference between MVC model 1 and model 2?

10,703

Solution 1

It appears that MVC1 (model1) did not have a strong break between the controller and the view where as in MVC2(model2), these concerns were separated.

See if this gives you any more insight: MVC1 and MVC2 discussion

More InformationJust a little more

Solution 2

I Think this is the main difference between MVC1 andMVC2:

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). But for MVC1 did not have a strong break between the controller and the view.

Solution 3

Model 1 Architecture: - Here JSP page will be responsible for all tasks and will be the target of all requests. The tasks may include authentication, data access, data manipulation etc. The architecture is suitable for simple applications.

Disadvantages: – Since the entire business logic is embedded in JSP chunks of java code had to be added to the JSP page. For a web designer, the work will be difficult as they mite face problems with business logic. The code is not reusable.

Model 2 Architecture : – The servlet act as the controller of the application and will be target of every request. They analyze the request and collect data required to generate response to JavaBeans object that act as model of the application. The JSP page forms the view of the application.

Advantages: – Reusability Ease of maintenance.

Share:
10,703
Alex Ciminian
Author by

Alex Ciminian

Updated on June 04, 2022

Comments

  • Alex Ciminian
    Alex Ciminian almost 2 years

    I've recently discovered that MVC is supposed to have two different flavors, model one and model two. I'm supposed to give a presentation on MVC1 and I was instructed that "it's not the web based version, that is refered to as MVC2". As the presentations are about design patterns in general, I doubt that this separation is related to Java (I found some info on Sun's site, but it seemed far off) or ASP.

    I have a pretty good understanding of what MVC is and I've used several (web) frameworks that enforce it, but this terminology is new to me. How is the web-based version different from other MVC (I'm guessing GUI) implementations? Does it have something to do with the stateless nature of HTTP?

    Thanks,
    Alex

  • Alex Ciminian
    Alex Ciminian almost 14 years
    So I'm guessing this originated from Java?