Model 2 architecture MVC pattern with Spring

The Model 1 architecture is not very straightforward for a web application. Model 1 also has decentralized navigation control, because in this architecture, each user contains a separate controller and also different logic to determine the next page. That time for web application, Model 1 architecture has Servlet and JSP as the main technologies to develop the web applications.

For a web application, the MVC pattern is implemented as a Model 2 architecture. This pattern provides centralized navigation control logics to easily test and maintain the web application, and it also provides better separation of concerns than Model 1 architecture for web applications. The difference between the MVC pattern based on Model 1 Architecture and the modified MVC pattern based on Model 2 architecture is that the latter incorporates a front controller that dispatches all incoming requests to other controllers. These controllers handle the incoming request, return the model, and select the view. take a look at the following diagram to better understand the Model 2 architecture MVC pattern:

As you can see in the preceding diagram, a new component is introduced for the MVC pattern, that is, the front controller. It is implemented as a javax.servlet.Servlet servlet such as ActionServlet in struts, FacesServlet in JSF, and DispatcherServlet in Spring MVC. It handles the incoming requests, and delegates the requests to the specific application controller. That application controller creates and updates the model, and delegates it to the front controller for rendering. Finally, the Front Controller determines the specific view, and renders that model data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset