geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Monson-Haefel <>
Subject Re: [components] - lazy loading...
Date Sat, 09 Aug 2003 19:13:29 GMT

Jules Gosnell wrote:

> I maintain that it's proper place is in here where the
> code only need be written once and will mature quicker. Since the
> container is also in charge of service lifecycle and interservice
> dependencies, it can make optimisations that the service cannot. (Of
> course the service has advantages over the container (self-knowledge),
> but could take advantage of them as well).
> Of course if you wish to override it in particular services, I wouldn't
> see a problem with that. You would simply register them as mandatory and
> let them take control of their own laziness.

I really like this Lazy Service Loading idea as a start up option.  Obviouisly,
you still need to also support an Aggresive Loading strategy which would result
in a slower start up, but less latency and more throughput in production.

It seems to me that the logic required to support lazy loading of services is
the same, regardless of the service.  Basically, if you access it, than it
should be loaded. And indexed and load it again on the next start up.  That
applies to everything from J2EE Connectors to instance pools.  If this type of
logic can be isolated than it can be placed to in the requests path all
services and designed to handle anything, without regard to the type of
service.  You could also tweak it using a configuration that says, Load these
services at start up, but load everything else lazily.  One algorithm and a
single point of control. Easy maintenance.

Richard Monson-Haefel
Author of J2EE Web Services (Addison-Wesley 2003)
Author of Enterprise JavaBeans, 3rd Edition  (O'Reilly 2001)
Co-Author of Java Message Service (O'Reilly 2000)

View raw message