上QQ阅读APP看书,第一时间看更新
Model 2 architecture
Model 2 architecture came in to solve the complexity involved with complex JSPs having multiple responsibilities. This forms the base for the MVC architecture style. The following image represents typical Model 2 architecture:
Model 2 architecture has a clear separation of roles between Model, View, and Controller. This leads to more maintainable applications. A few important details are as follows:
- Model: Represents the data to be used to generate a View.
- View: Uses the Model to render the screen.
- Controller: Controls the flow. Gets the request from the browser, populates the Model and redirects to the View. Examples are Servlet1 and Servlet2 in the preceding figure.