Hi All,

I have a question that nobody at my workplace seem to be able to really
answer. I have looked through all kinds of documentation but have not found
a really well described reason why "Beans.instantiate()" is better.

Basically I am writing JavaBeans for JSP that need to be thread-safe and all
and will need to use other JavaBeans as well. I read a few remarks in
different books that say you should use Beans.instantiate() over "new" (i.e.
just creating a new instance of the class), and I feel that's true, but I
don't really get why...

Is it because the container of the application server would not be able to
manage resources correctly? Could you get resource problems because you
would break out of the "session" or something? Is there a danger that the
created instances don't get pooled because they are instantiated as objects
that the app server don't know about?

Anybody can answer this question? Many thanks.

Cheers

Jay

===========================================================================
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

Reply via email to