Conclusions


In this chapter, we covered the basics of the Model-View-Controller (MVC) design pattern, its history, and how it is implemented in Struts. We also covered the origins of the terms Model 1 and Model 2 JSP development. Struts is based on Model 2.

The Model-View-Controller design pattern is a time-proven architecture for building software that manages interaction with users (using Views), implements business rules that are dependent on user input (using Controllers), and relies on data that exists in a remote database or system (accessed using Model components ). MVC originated at the Xerox PARC in the late 1970s, although its roots go back even further.

The terms Model 1 and Model 2 originated in the JSP 0.92 specification. The primary characteristics of Model 1 are

  • HTTP requests are posted directly to .jsp files.

  • The logic for directing program flow, for accessing databases and remote systems, and for building user displays are all embedded directly in JSP files.

The primary characteristics of Model 2 are

  • HTTP requests are posted to Java servlets.

  • The logic for directing program flow (Controllers) and for accessing databases and remote systems (Models) are implemented in Java servlets and classes. All user displays (Views) are built using JSP files.

Struts implements the MVC design pattern and is based on Model 2. Struts implements MVC using

  • Model components that provide a programming model of back-end databases and remote systems and services

  • View components that use JSP and Struts custom tags to build pages for user presentation

  • Controller components that implement the business logic that defines the program flow



Struts Kick Start
Struts Kick Start
ISBN: 0672324725
EAN: 2147483647
Year: 2002
Pages: 177

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net