> From: Stephen McConnell [mailto:[EMAIL PROTECTED] > > Leo: > > Thoughts concerning the current code: > > /** > * Handles singleton A4 components. Right now, we only > * support the LogEnabled and Serviceable interfaces. > */ > public class Avalon4ComponentHandler implements > Handler, LogEnabled, LifecycleInterceptable, Serviceable { > > Two things based on dealing with similar stuff: > > * separate lifestyle concerns from new instance stuff > > Basically a lifestyle handler encapsulates the decision > concerning when > a new instance is required. In the activation package you will find a > LifestyleManager interface, a set of implementations, and a > LifestyleManager factory. The factory is supplied with a > ComponentFactory which deals with the setup and tearddown of > components.
That makes sense - esp when considering pooling etc... > What I think you describing in Avalon4ComponentHandler looks to me > like an implementation of a component factory. Yep. I'll check the files you mentioned - no point in reinventing the wheel... > Second point - I think its a bad ide to use interface such as > Serviceable etc. to provide a ServiceManager to a factory > when in fact > the factory isn't using the manager to resolve a dependency - but is > instead using the object as an argument in subsequent > operations. The point of doing that is that if the Handler had been a PicoHandler instead of an A4 handler, the handler *would* have used the ServiceManager to resolve dependencies. It just happened that the SM could be given to the component directly in this case. > Definely feel free to ignore all of the above - your in experimental > mode and I'm just tossing in thoughts as they occur. Any feedback is appreciated - bring it on! Thanks for taking the time to look at the code. /LS --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
