You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Stavrinides <P....@albourne.com> on 2009/06/29 14:17:14 UTC

Override an IoC service

Hi, 

I have recently introduced a multiple IoC module structure into my web applications, so I have a core web module and then application specific modules separately, and now I am getting the following error:
ERROR - Service interface com.albourne.web.interfaces.ISiteError is matched by 2 services: CoreError, SiteError.

I have introduced these changes mostly for testing purposes... its not a big problem as I can simply remove the offending service from the shared core and provide an implementation of it in each application specific module, but it got me wandering about this issue on a larger scale, is it possible to override a service? if not would such a feature be useful? How do others deal with this, using service decoration potentially? 

Kind regards,
Peter




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Override an IoC service

Posted by Peter Stavrinides <P....@albourne.com>.
Brilliant!

Thanks
Peter


----- Original Message -----
From: "Thiago H. de Paula Figueiredo" <th...@gmail.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Monday, 29 June, 2009 15:20:26 GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: Re: Override an IoC service

On Mon, Jun 29, 2009 at 9:17 AM, Peter
Stavrinides<P....@albourne.com> wrote:
> Hi,

Hi!

> I have introduced these changes mostly for testing purposes... its not a big problem as I can simply remove the offending service from the shared core and
> provide an implementation of it in each application specific module, but it got me wandering about this issue on a larger scale, is it possible to override a
> service? if not would such a feature be useful? How do others deal with this, using service decoration potentially?

Yes, you can override services:
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html.

-- 
Thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Override an IoC service

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, Jun 29, 2009 at 9:17 AM, Peter
Stavrinides<P....@albourne.com> wrote:
> Hi,

Hi!

> I have introduced these changes mostly for testing purposes... its not a big problem as I can simply remove the offending service from the shared core and
> provide an implementation of it in each application specific module, but it got me wandering about this issue on a larger scale, is it possible to override a
> service? if not would such a feature be useful? How do others deal with this, using service decoration potentially?

Yes, you can override services:
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html.

-- 
Thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org