Drawbacks of the JSP Model 1 Architecture

By: Barbara Emailed: 1651 times Printed: 2123 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

The Model 1 architecture has one thing going for it: simplicity. If your project is small, simple, and self-contained, it's the quickest way to get up and running. But the previous example, although by no means large or complicated, already illustrates a number of the disadvantages of Model 1 architecture:

  • It becomes very hard to change the structure of such Web applications because the pages are tightly coupled. They have to be aware of each other. What if you decide that, after updating the quantities in a shopping cart, you want to redirect the user back to the catalog? This could require moving code from the shopping cart page to the catalog page.

  • Large projects often involve teams of programmers working on different pages, and in the Model 1 scenario, each team would have to have a detailed understanding of the pages on which all of the other teams were working; otherwise, modifying pages could break the flow of the application.

  • Pages that are linked to from many other pages have to handle those other pages' logic, such as a cart update. In this way, they can accumulate a large amount of code that hasn't got an awful lot to do with the page itself. This reduces their coherence, making them harder to understand and to maintain.

  • Presentation and application control logic are mixed up, making it hard for a Web designer to change the pages without messing up the Java code. And vice versa: it's very hard for a developer to change control logic that may be hidden in lots of HTML markup.

  • The lack of separation between presentation and logic means that providing multiple presentations carries a very high cost. What if you decide to sell pizzas via Wireless Application Protocol (WAP) or personal digital assistant (PDA) devices? These devices are radically different from Web browsers and require completely different presentation structure and formatting. Your only choice would be to produce a whole new set of pages and duplicate the application logic. You'd have to implement every subsequent change to the logic in more than one place. Soon enough, changes will become very hard to manage, and the implementations will start to diverge.

Of course, the obvious way to get around these problems is to separate out the presentation code from the application control logic. This leads you onto the next architecture, JSP Model 2 architecture.


JSP Home | All JSP Tutorials | Latest JSP Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(2)


1. View Comment

Good explanation with simple language and style. Nice and I expect more.
Thanks a lot.


View Tutorial          By: Ismail. MC at 2009-03-31 04:46:04
2. View Comment

precisely the drawbacks I am trying to address in my new presentation library renderSnake. The only danger left in there is that developers still can mix logic from different layers.

View Tutorial          By: ernest at 2011-02-05 02:16:13

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Barbara
Configuring JDBC DataSources in Struts
What are the different scopes in JSP?
Drawbacks of the JSP Model 1 Architecture
Struts Classes

More Tutorials in JSP
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: `java.net.BindException: Permission denied <null>:80
JSP Alert Example
JSP CheckBox Example
Uploading an Image to a Database using JSP
Uploading a file to a server using JSP
A JSP page that gets properties from a bean
The page Directive in JSP
The taglib, tag, include, attribute and the variable Directive in JSP
Declarations in JSP
Scriptlets and Expressions in JSP
Tag Libraries in JSP
The Request Object in JSP
The Response Object in JSP
The Out Object in JSP
The Session Object in JSP

More Latest News
Most Viewed Articles (in JSP )
What are the different scopes in JSP?
Automatically Refreshing a JSP
JSP CheckBox Example
JSP Example to connect to MS SQL database and retrieve records
JSP Alert Example
JSP Program for display Date
Arithmetic Evaluation Using the Expression Language in JSP
Sending Email using JSP
Enable/Disable Scripting Elements in JSP
Uploading an Image to a Database using JSP
Embedding java codes in jsp sciptlets
Tags using in jsp
Declaring variable in JSP
Retrieving a Portion of a String
The IterationTag Interface in JSP
Most Emailed Articles (in JSP)
Steps to get a Free SSL certificate for your Tomcat
Retrieving a Portion of a String
What is JSP?
Tag libraries
Built-in Object in Javascript
Closing Windows
Getting HTTP Request Headers in a JSP
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: `java.net.BindException: Permission denied <null>:80
What is JSP?
Click to Activate and Use this control
Tags using in jsp
Radio Object
Frame Object
Math Object
The TryCatchFinally Interface in JSP