That depends on whether the helper classes are thread-safe or not. If they
are, then you can instantiate them in init() and reuse them all you want.
If they aren't, then you can't.  If the classes need to maintain expensive
resources, it might be worth making them thread-safe if they aren't already.

For more on this, read up on the servlet lifecycle on the web or in the
various servlet books.

At 10:27 AM 8/3/2000 +1000, you wrote:
>Hi everybody,
>
>I have a servlet that uses 2 helper classes for both the doGet() and
>doPost() methods, should the servlet class maintain data members that
>points to both of these helper classes OR should I create an instance of
>the helper classes only inside the doGet() and doPost() methods? What is
>the best design to use?
>
>Thanks
>Nelson
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

---
William Crawford                                        + 01 617 577 7844
Invantage, Inc                                            [EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to