Summary

I l @ ve RuBoard

Struts is an application framework based on the Model-View-Controller design pattern. In a Struts application, a controller decides what actions to take and where to pass control based on the results of validating form data through an ActionForm and applying business logic found in the Action .

In addition, Struts offers a customer tag library that allows many common JSP tasks , such as iterating over a collection to be replaced with a single tag.

There's no question that in some places it's appropriate and desirable to use an MVC design, such as the one that Struts offers. It gives you centralized control of your URLs, helps separate your business logic from the JSP display code, and promotes code reuse.

On the other hand, it can be extremely difficult to code. You have to think about three different pieces at the same time (the JSP, the ActionForm , and the Action) , and making changes on the fly is much more difficult. You also start to lose the overall sense of the application structure because many things (such as deciding which page to go to next ) begin to happen as side effects behind the scenes.

It is often good advice to reserve MVC-based sites for applications large enough to warrant them. Using MVC design for a small or even medium- size problem could be a little bit like using a jack hammer to drive finishing nails . You'll end up spending more time configuring and setting up objects than actually implementing business logic.

I l @ ve RuBoard


MySQL and JSP Web Applications. Data-Driven Programming Using Tomcat and MySQL
MySQL and JSP Web Applications: Data-Driven Programming Using Tomcat and MySQL
ISBN: 0672323095
EAN: 2147483647
Year: 2002
Pages: 203
Authors: James Turner

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