On Mon, Aug 31, 2015 at 2:53 AM, Jochen Kemnade <jochen.kemn...@eddyson.de>
wrote:

> Hi,
>
> I'm not sure if this is a good idea.
>

Hi!


> If the registry contains multiple implementations of the same interface,
> there's usually a reason for it and the developer should need to think
> about which implementation is to be injected where. Also, it makes the code
> easier to understand if there is an explicit marker annotation along with
> @Inject.
>

Sometimes you have more than one service implementing the same interface
but not actually all of them are intended to be services. Otherwise, you
just need to use ObjectLocator.autobuild() everywhere. Sometimes you have a
service defined by an interface and you want another service which is
defined by a subinterface.


> It should however be possible to override ServiceInjectionProvider with an
> implementation that behaves like that.
>

Contributing an InjectionProvider would only cover pages, components and
mixins, not injection into services.


>
> What do you guys think? It would be helpful specially for objects
>> contributed to a service configuration and you want them to be services
>> by themselves.
>>
>
> Isn't @Local usually sufficient for that use case?
>

Nope, because sometimes the expected default implementation of a service
comes from another module.


>
> Jochen
>
>
>> On Tue, 25 Aug 2015 10:15:45 -0300, Nathan Quirynen (JIRA)
>> <j...@apache.org> wrote:
>>
>> Nathan Quirynen created TAP5-2491:
>>> -------------------------------------
>>>
>>>              Summary: Default marker annotation
>>>                  Key: TAP5-2491
>>>                  URL: https://issues.apache.org/jira/browse/TAP5-2491
>>>              Project: Tapestry 5
>>>           Issue Type: Improvement
>>>           Components: tapestry-core
>>>     Affects Versions: 5.3.7
>>>             Reporter: Nathan Quirynen
>>>             Priority: Minor
>>>
>>>
>>> It would be nice when making use of Marker annotations for tagging a
>>> service, that a default marker value could be defined. So when no
>>> marker annotation is added to the injection of the service this
>>> defined default will be used.
>>>
>>>
>>>
>>> --
>>> This message was sent by Atlassian JIRA
>>> (v6.3.4#6332)
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: dev-h...@tapestry.apache.org
>
>


-- 
Thiago

Reply via email to