You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Taylor Mathewson (JIRA)" <ji...@apache.org> on 2009/08/06 18:32:15 UTC

[jira] Commented: (TAP5-799) Overriden Service Injected Into Page via @Inject Loses Decoration

    [ https://issues.apache.org/jira/browse/TAP5-799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740138#action_12740138 ] 

Taylor Mathewson commented on TAP5-799:
---------------------------------------

So it turns out the workaround above injects the non-overriden but properly decorated service.

I'm going to try using decoration as suggested by Mr. de Paula Figueiredo on Nabble, but as far as I can tell, service overriding per the "new" way ignores decoration.

> Overriden Service Injected Into Page via @Inject Loses Decoration
> -----------------------------------------------------------------
>
>                 Key: TAP5-799
>                 URL: https://issues.apache.org/jira/browse/TAP5-799
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-ioc
>    Affects Versions: 5.1.0.5
>            Reporter: Taylor Mathewson
>
> I have a Core Module which binds a service impl to an interface, and decorates it (hibernate transaction decorator, and a couple of custom things)
> I have page beans which reference the service, e.g.:
> @Inject
> private SomeService someService;
> Everything works fine up to this point.
> I add in an Extension Module, which refers to the Core Module as a submodule, and overrides the service impl, e.g.:
>     public static void contributeServiceOverride(MappedConfiguration<Class, Object> configuration, ObjectLocator locator) {
>         configuration.add(SomeService.class, locator.proxy(SomeService.class, ExtendedSomeServiceImpl.class));
>     }
> My services all get the right stuff, but the pages get the extended service impl without any decoration.
> This can be worked around by the following:
> @InjectService("SomeService")
> private SomeService someService; 
> Workaround is cumbersome and loses the elegance of injection by type.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.