I am trying to ansewr but I am not claiming that I am right.
When instantiate() method is called, Jvm looks for the class file in
directories in the classpath also looks for jar files. ALSO looks for .ser
files where beans are serialised. This file contains data along with the
methods. when you instantiate() this bean it shows you all stored
properties. For example, if i have extended a AWT button and just changed
its color to blue. now i have created .ser file of this class. then after
instantiation, I see blue button.
If I am not making sense, please ignore it.
-----Original Message-----
From: Jay Thoden Van Velzen [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 21, 2000 1:54 AM
To: [EMAIL PROTECTED]
Subject: "new" or "Beans.instantiate()" ?
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
===========================================================================
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