Chapter 12: Designing Web Applications and Servlet Patterns

 < Free Open Study > 



Overview

In previous chapters we've seen that servlets are great at handling requests and responses, but they're not so good for generating content for end users. We also wouldn't use JSP pages to process business logic, although they do handle content generation very effectively. To make the most of servlets, or any other components within a web application, we need to understand when and where we should use them - what tasks do they perform best?

In this chapter we're going to look at the design of web applications, focusing particularly on when and where we should use servlets within the application.

We'll begin by discussing the most commonly used web application architectures:

  • Model 1

  • Model 2

We'll look at important factors such as the maintainability, reusability, and extensibility of each. We'll introduce design patterns, which we can use to recognize and solve common design problems. Then we'll demonstrate how these patterns can be applied to a web application.

In order to put all of these concepts into context we'll create an example application - an online discussion forum, to which we'll apply our designs and patterns. In order to compare and contrast good and bad design, we'll build two versions of this example: the first using Model 1 architecture, and the second using Model 2.

However, let's start simple, by considering why good application design is important.



 < Free Open Study > 



Professional Java Servlets 2.3
Professional Java Servlets 2.3
ISBN: 186100561X
EAN: 2147483647
Year: 2006
Pages: 130

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