Leo Sutic wrote:
> 
> > From: Carsten Ziegeler [mailto:[EMAIL PROTECTED]]
> >
> > Would work, but if that's the case, I have to implement a
> > "factory", the parser itself (including the "factory"
> > interface, the parser interface) etc. and I don't see the
> > great advantage in using a component framework anymore as I
> > code most part myself.
> >
> > Am I wrong?
> 
> Carsten,
> 
> you got it right. Those are exactly the implications of the
> proposal.
> 
> Now for the good parts: The factory can be generic.
> So I code up a PooledFactory that takes your component class
> as a parameter, and bam there we go.
> 
> The only change is that you'll have to grab the factories
> out of the ComponentManager in the compose() method:
> 
> <component role="org.ziegeler.CarstensComponent"
>            class="Avalon4Factory"
>            avalon-4-class="org.ziegeler.CarstensA4Component"
>            pool-min="2"
>            pool-max="4"/>
> 
> ...
> 
> public class CarstensComposer {
> 
>     A4Factory carstenFactory;
> 
>     public void compose (ComponentManager manager) {
>         carstenFactory = (A4Factory) manager.lookup
> (org.ziegeler.CarstensComponent.ROLE);
>     }
> 
>     public void doStuff () {
>         CarstensComponent comp = (CarstensComponent)
> carstenFactory.getInstance ();
>         try {
>             comp.doStuff ();
>         } finally {
>             carstenFactory.release (comp);
>         }
>     }
> }
> 
> Look at the configuration snippet, and replace "class" with
> "handler-class" and "avalon-4-class" with "class" and you get
> the idea.
> 
> ..or am I trying to do the impossible here?

Ok, but *WHY*?

I have a gut feeling that you'll need *STONG* arguments (or a bunch of
time to volunteer) to make the cocoon-dev community buy that.

Moreover, I was told that Component was changed to Object to allow
non-avalon stuff to be returned by the CM and now you force these to be
thread-safe?

These two solutions tend to push in different directions, IMHO.

Please, explain.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<[EMAIL PROTECTED]>                             Friedrich Nietzsche
--------------------------------------------------------------------



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to