At 7/17/2004 03:57 PM, you wrote:
On Jul 17, 2004, at 4:06 PM, Ralph Goers wrote:
Thanks, it does. But just to make sure... A Component marked as ThreadSafe and declared with <component> in cocoon.xconf will be a singleton. If I had several implementations of an interface, I could define a role in cocoon.roles, implement a selector, and using that role declare the implementations in cocoon.xconf using <component-instance>.
In most cases, yes a Component marked ThreadSafe is a singleton. There is one case I have encountered where this is not true - I have a Component that manages to be called before the ComponentManager has run. In that case it is instantiated once when it is called and again when the ComponentManager runs. This is a wierd case though - you have to try really hard to encounter it.
Yes - if you have several implementations of an interface you would do exactly what you suggest, although you don't have to implement your own selector - Cocoon's should work in most cases.
You can look at Input Module or Source Factory definitions in cocoon.xconf and cocoon.roles - as well as the corresponding classes - to get great examples of how this works.
Ralph
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
