Originally posted by Gian Franco Casula:
Hi there,
What does 'Model 2' imply with respect to frameworks?
Can anyone give me a reference to some litterature
describing the concept of Model 2?
Thank you,
Gian Franco Casula
Here is a simple explanation of Model 1 vs. Model 2 architectures. When
JSP was first introduced by Sun, the specs discussed two approaches for building web apps using JSP. In Model 1, the JSPs controlled the flow of the application. Model 2 presented the idea of a central
servlet that processed all requests and presented the appropriate JSP to continue the flow of the application. Essentially the Model 2 approach described the Model-View-Controller (MVC) pattern.
Struts as a framework supports the Model 2 (MVC). Struts provides the Controller, JSP provides the View, and the Model is provided by
EJB or a direct link into
JDBC.
For more reading and to get up to speed quickly on Struts, I recommend O'Reilly's "Programming Jakarta Struts" (which has on it's cover a picture of a horse "Strut"ting across the page). Of course the real meaning of the name Struts is that it provides the foundation for building your application, but it is a cute play on words nonetheless.
Hope I helped.
Michael