commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Essl <christiane...@yahoo.de>
Subject Re: [HiveMind] Why was overridable reomved from service?
Date Thu, 04 Sep 2003 22:35:50 GMT
Thank you. This is realy the better aproach.

On Thu, 4 Sep 2003 14:55:55 -0400, Howard M. Lewis Ship 
<hlship@comcast.net> wrote:

>
>> As I see the option to override the contribution to a service was 
>> removed. The cvs log just states that this was
>> a bad idea. Why was override a bad idea?.
>
> It led to a lot of ambiguities as I was adding new service models. I 
> found other, better ways to
> accomplish the same kind of thing.
>
>
> <service id="OriginalService" ....>
> </service>
>
> <extension point-id="hivemind.FactoryDefaults">
> <default symbol="ServiceToUse" value="mymodule.OriginalService"/>
> </extension>
>
> <service id="MyDependentService" ...>
> <invoke-factory service-id="hivemind.BuilderFactory">
> <construct ...>
> <set-service property="otherService" service-id="${ServiceToUse}"/>
> </construct>
> </invoke-factory>
> </service>
>
>
> Using symbols for indirection, MyDependentService will be linked to 
> OriginalService.
> Now, in another module:
>
>
> <service id="ReplacementService" ...>
>
> <extension point-id="hivemind.ApplicationDefaults">
> <default symbol="ServiceToUse" value="newmodule.ReplacementService"/>
> </extension>
>
>
>
> ApplicationDefaults override FactoryDefaults.  MyDependentService will 
> now be linked to
> ReplacementService.
>
> The advantage to this system is that ReplacementService can gain access 
> to OriginalService.  This is
> important to me, because this is a very common pattern in Tapestry, where 
> it is common to wrap the
> default service implementation with a thin wrapper that adds some special 
> features.  I want a
> graceful way to accomplish the same thing in HiveMind.
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Mime
View raw message