On Tue, 2001-08-28 at 00:02, Bryan Field-Elliot wrote:

> 
> Also, you go on to say 'ditto for objection creation", and that it's 
> "more expensive to cache an object than recreate it". Where are you 
> getting this information? It goes against the design considerations of 
> virtually every "highly optimized" Java system I've seen, including EJB 
> which goes to EXTREME lengths to reuse rather than recreate. You see the 
> same pattern with JSP custom tags (nowadays they are pooled), and you 
> even see the same thing in the Servlet spec design (which is to have one 
> multithreaded instance of the servlet class, rather than one per user 
> which would make more logical sense).

Object creation is rather fast, but that doesn't mean caching is always
frowned upon.  Caching for performance at the enterprise level is really
to reduce object initialization rather than object creation.  The
problem with EJBs, Tags, and Servlets is that they potentially do a lot
of up front initialization.  All three has to at least read an XML to
load some kind of deployment information, and then there are resources
(db, networking) that can be allocated by containers or developers.
Struts objects generally don't a lot of object initialization, therefore
isn't necessarily a really good candidate for caching.


Calvin

Reply via email to