cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: ComponentManager
Date Mon, 11 Jun 2001 13:04:33 GMT
Torsten Curdt wrote:
> At least for me it would be useful to have a static
> method to get to the cocoon component manager instance.
> Not all of our classes are really what I would characterize
> as a component. So I need to pass the component manager
> to all my classes.
> Isn't it reasonable to have a static access to the
> component manager as there is e.g. for the logger?
> Or should this be considered a bad design/idea?

No.  It is not necessary for a class to be a Component for
it to implement Composable.  You would have to manage the
passing of the ComponentManager yourself, though.

Regarding the design of the ComponentManager, it is supposed
to be assigned using the Inversion of Control pattern.  This
helps guarantee a level of security in that access to a
Component within a ComponentManager has to be managed.  We don't
want to allow rogue code to obtain instances to components.
This is bad.  While nothing is foolproof, the IOC approach does
make obtaining the ComponentManager more maneagable, with known

The Logger was designed to be used with Avalon, and separate
from Avalon.  Also, the impact of obtaining a Logger by
malicious code is significantly less than that of obtaining
a ComponentManager.

To unsubscribe, e-mail:
For additional commands, email:

View raw message