• Post Reply Bookmark Topic Watch Topic
  • New Topic

whether this architecture is feasible..to the Authors!!!!!  RSS feed

Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I have the following doubts:
I was thinking about the following architecture for a
web based application -
having a single servlet which would receive all requests.
The rest of the modules of the application can be classes.
The servlet would do
* the authentication,
* log the result of the same (who logged in, when and if
the attempt is unsuccessful - log the same)
* the connection pool object would be in the servlet context
its getConnection() method would return a connection to the
database. This method would be passed to the method of the
class instantiated
* check if the user has rights to access the module asked for
(say - prepare a sales order)
* if the user has the rights, then it would insantiate the
sales order class and call the appropriate method of the
class depending on the type of the request (prepare a new
sales order, modify an existing sales order, query an order
in short the servlet would have a huge switch case which
would take care of the business logic. These would return
the html to the servlet and the servlet calls some template files , does pattern matching and outputs the
html content to the browser in one out.println() statement(this is similar to what a jsp does but here we are having plain text files with placeholders which is read at runtime and pathched with the results of the databse Query..in short we call it Template Patching)
do you think that such big a servlet would cause performance
issues - one because all requests to the servlet would be
handled by this one servlet and another it would instantiate
the business class required and process it.
My main question is - will the classes be reused once they are
instantiated in RAM (on the next hit) OR are we completely at the
mercy of the garbage collector (ie if he leaves the class object
in RAM then and then only would it be reused, else the next request
for the same class would need the instantiation again)?
Because servlets are internally threaded, would the object
instantiated by one thread be available to another thread?
if yes, then do i need to take care about the mutation of public
variables in the class.
in the servlets case, i feel that i may get some benefits..
but that again is a feeling - no arguments in support
EXPERIENCE...I would like to know where would this approach go haywire.Though it may seem very close to STRUTS but still it is different form it
as we are proposing not to uses HttpSessionAPI but our our Session Module which maintains the session as database objects, similarly we would be using our own Authentication ans Authorization module
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!