Craig,
Thanks a lot for sharing your knowlege with list members.
>
> I use a Hashtable for two different purposes:
>
> * Map from the action name requested to the name of the
> Java class I want to execute for this Action name. I usually
> configure this with servlet initialization parameters, but there's
> lots of choices.
>
> * Map from the action name to the one and only existing
> instance of this action class. I only create such an instance
> the first time this action is requested -- after that, I use the
> same one for all requests, to avoid the object creation
> overhead for at least this one object.
I was just wondering ...
Your are using a single instance of action class to process all the requests.
Also to keep it thread safe, you don't use any instance variables. In that case
why do we even need a single instance ? Why can't we just invoke the "static"
method from the class. Something like Integer.ParseInt () ?
Is it a bad practice to use classes this way ? or it has something to do with
the fact that static methods are not overridden ?
thanks,
- Rajesh
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets