Model 1 vs. Model 2 Architecture

JSPs are usually coded using either a JSP Model 1 or Model 2 architecture. When designing an application using Model 1 architecture, the target of every request is a JSP. All business logic is coded inside the JSP or in JavaBeans. For very simple applications, this model is functional, but for even moderately complex applications, it is preferable to use the Model 2 architecture. In the Model 1 architecture, the JSP handles all of the work for authentication, creating and using JavaBeans to access data, and generating the HTML interface.

In the Model 2 architecture, also known as Model-View-Controller 2 (MVC2), all requests are first handled by servlets. The servlet processes the request, creating any required JavaBeans and then forwards the processing to the JSPs. The JSP can use the JavaBeans that were created by the servlet to generate the resulting HTML page. Using MVC2 increases the maintainability of your application by separating the presentation layer from the business logic. All but the simplest applications should use MVC2 architecture. When using MVC2, the only responsibility of the JSP is presentation to the client. Oracle has built-in support for the Jakarta Struts Framework that can be used to build MVC2 based applications.

Oracle Application Server 10 g provides support for a Struts-based controller framework and is currently the standard controller mechanism for many web applications. When you combine Struts with your JSPs, your application s design is considerably more robust.

Note  

This is what the Application Development Framework (ADF) in Oracle JDeveloper 10g is all about. We cover the ADF in Chapter 13.



Oracle Application Server 10g Web Development
Oracle Application Server 10g Web Development (Oracle Press)
ISBN: 0072255110
EAN: 2147483647
Year: 2004
Pages: 192

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