Mastering Spring 5.0
上QQ阅读APP看书,第一时间看更新

Model 1 architecture

Model 1 architecture is one of the initial architecture styles used to develop Java-based web applications. A few important details are as follows:

  • JSP pages directly handled the requests from the browser
  • JSP pages made use of the model containing simple Java beans
  • In some applications of this architecture style, JSPs even performed queries to the database
  • JSPs also handled the flow logic: which page to show next

The following picture represents typical Model 1 architecture:

There are a lot of disadvantages in this approach, leading to quick shelving and the evolution of other architectures. A few important disadvantages are listed as follows:

  • Hardly any separation of concerns: JSPs were responsible for retrieving data, displaying data, deciding which pages to show next (flow), and sometimes, even business logic as well
  • Complex JSPs: Because JSPs handled a lot of logic, they were huge and difficult to maintain