What is mvc2 architecture
As we saw the thick line difference between MVC and MVC2 despite having similar names but both are used as solutions for recurring system design problems. MVC2 is more complex and has a separation of concerns which is utilized for bigger applications or intuitive user experience because of its centralized feature where all the requests are handled by one controller.
Hence, the MVC2 is easier to maintain for multiple users because of its reusability and extend feature and is capable of supporting a more complicated system in real-time, like, Facebook , Instagram.
Skip to content If there is any problem in software development then its design pattern is the main solution to fix this. In MVC2, there are multiple components for receiving requests and sending responses. In MVC, each JSP has a controller and view logic that determines the navigation of the next view page that makes it redistributed. Please note that there is no mention of the technologies used in MVC architectural implementations in the above response.
This is consciously done to drive the point that MVC is an application development architecture that does not concern itself with what technologies implement it in the actual product.
In model1 only JSP and Beans are involved. Whereas in Model2 there is servlet that act as a front controller i. The main dfeerence between mvc1 and mvc2 is.. In mvc1 we can have multiple controller servlets but in mvc2 we can have only one controller servlet. For example struts frame work is built on mvc2 architecture, which is having only one controller i. MVC1 is appropriate for simple development and prototyping. It is not, however, recommended for serious development.
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.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 10 months ago.
Active 1 year, 10 months ago. The advantage of creating thread over process is that it doesn't allocate separate memory area. Thus many subsequent requests can be easily handled by servlet. Problem in Servlet technology Servlet needs to recompile if any designing code is modified. It doesn't provide separation of concern. Presentation and Business logic are mixed up. JSP overcomes almost all the problems of Servlet.
It provides better separation of concern, now presentation and business logic can be easily separated. You don't need to redeploy the application if JSP page is modified. As you can see in the above figure, there is picture which show the flow of the model1 architecture.
The MVC design pattern consists of three modules model, view and controller. Model The model represents the state data and business logic of the application.
View The view module is responsible to display data i. Controller The controller module acts as an interface between view and model.
It intercepts all the requests i. It uses the declarative approach for defining view components, request mapping etc. It resolves the problem of Model 2 architecture. The Struts framework provides the configurable MVC support. In struts 2, we define all the action classes and view components in struts.
0コメント