You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Lars Trieloff <la...@trieloff.net> on 2006/09/08 13:54:30 UTC

Excalibur and Factory-Methods

Hi,

we are currently writing a SourceFactory for Cocoon that should be 
configured via the XConf XML format.

The only problem is that a dependency of this SourceFactory cannot be 
instantiated via a Constructor as Excalibur does by default, so I am 
looking for the equivalent of Spring's factory-method attribute.

Lars


Re: Excalibur and Factory-Methods

Posted by Carsten Ziegeler <cz...@apache.org>.
Lars Trieloff wrote:
> Hi,
> 
> we are currently writing a SourceFactory for Cocoon that should be 
> configured via the XConf XML format.
> 
> The only problem is that a dependency of this SourceFactory cannot be 
> instantiated via a Constructor as Excalibur does by default, so I am 
> looking for the equivalent of Spring's factory-method attribute.
> 
I'm not sure if I understand your problem correctly, but the
SourceFactory is a factory :) which creates source objects. So in fact
the source factory could be a singleton, so there shouldn't be a need to
create a factory which creates the SourceFactory.
If you need other components in your implementation you can implement
Serviceable, get a service manager and can lookup components from there.
If you need configuration from the xconf you can implement Configurable.

Is it this you're looking for?

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/