aspose file tools*
The moose likes JSP and the fly likes Page-centric design vs Servlet-centric design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Page-centric design vs Servlet-centric design" Watch "Page-centric design vs Servlet-centric design" New topic
Author

Page-centric design vs Servlet-centric design

TD Bartos
Greenhorn

Joined: Mar 29, 2005
Posts: 9
I've recently been reading 'Web Development with Java Server Pages' by Fields, Kolb, and Bayern from Manning press. They describe in great detail in Ch. 10 Servlet-centric design and provide a sample program in Ch. 11.

I'm researching re-writing a JSP application, which follows a page-centric design. I'm trying to evaluate the servlet-centric design to see if applying it makes sense for our application. Our application has a high level navigation bar, and very free-form workflows through each of these high level sections. There are connections between the highlevel sections of the application, i.e. deep in workflow navigation in section 2, I can jump with information to section 1. At what point would a single servlet containing workflow logic just become a large unmanageable mess?

Anyone have any real life experiences with servlet-centric jsp application design? What is it good for, and where does this design practice fall short?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

What you are describing is the Model 1 vs. Model 2 design patterns. Modern conventional wisdom greatly favors the Model 2 approach. I resist calling Model 2 "servlet-centric" because it really isn't -- it uses servlets and JSP each to their best advantage.

With regards to:

At what point would a single servlet containing workflow logic just become a large unmanageable mess?


the asnwer is: as soon as it tries to do more than one thing.

A Model 2 architecture does not cram all logic into a single servlet. Rather, many individual servlets provide the logic. Perhaps you are misconstruing the Front Controller pattern?
[ February 21, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

I've recently been reading 'Web Development with Java Server Pages' by Fields, Kolb, and Bayern from Manning press.


That's actually a pretty good book, but bear in mind that it's pretty old at this point. JSP and web architecture patterns have come a long way since then.

You might want to locate a more modern reference. And of course, you should start with the JSP Specification itself.
[ February 21, 2006: Message edited by: Bear Bibeault ]
TD Bartos
Greenhorn

Joined: Mar 29, 2005
Posts: 9
i've got the second edition of the book (but it's still from 2002).

do you have suggestions for current books?

i've been doing JSP development for about a year and a half now, but have just picked it up kind-of adhoc as i've needed to learn things. I feel pretty comfortable with the language, but much less knowledgeable in how to architect a high level design for our application leveraging JSP's strengths. The chapters on architecting with JSP is what drew me to the manning book.

thanks!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you search this and the servlet forum with keyword "book" or "books" you'll find that there are several threads per week with this question.

There are two or three books that get mentioned in almost every one of them.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Page-centric design vs Servlet-centric design