| Author |
optimum number
|
eswar kumar
Ranch Hand
Joined: Oct 20, 2002
Posts: 98
|
|
|
what are the optimum no of servlets required for a project?
|
 |
Andres Gonzalez
Ranch Hand
Joined: Nov 27, 2001
Posts: 1561
|
|
Originally posted by eswar kumar: what are the optimum no of servlets required for a project?
there's no optimum number of servlets. It all depends on how you architecture your application and how complex it is. You can use a single servlet to do *all* tasks if you want, but at the end you'll find yourself in a complete chaos
|
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26193
|
|
|
Some frameworks, like Struts, have one servlet. That servlet delegtes all responsibilities to other classes. That way the servlet doesn't grow in complexity and the separate actions stay manageable.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Tim Baker
Ranch Hand
Joined: Oct 04, 2003
Posts: 541
|
|
|
so it depends on if you want to put all your code in servlets or not. if you do then each servlet should have a very specific task. if there are multiple pages that do the same sort of thing then they can be done in the same servlet, but very different pages should have their own. if you have shared functions accross different pages then you need to abstract the code into classes and use it accross the different servlets.
|
Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
|
 |
 |
|
|
subject: optimum number
|
|
|