You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Carsten Klein <ca...@axn-software.de> on 2012/06/11 08:52:42 UTC

Re: [jira] [Created] (TAP5-1955) Documentation on ServiceBinder#bind(Class implementationClass) is wrong/lacks extra information

> On Fri, 08 Jun 2012 17:16:22 -0300, Carsten Klein (JIRA) <ji...@apache.org>
> wrote:
>
>>> Defines a service in terms of an implementation class, without a
>>> service interface. In this case, the service
>>> will not be proxiable (proxying requires a service interface) and
>>> {@link ServiceDef#getServiceInterface()} will
>>> return the implementation class. In this situation, the service will
>>> not be proxied; it will be instantiated
>>> fully on first reference (ignoring its scope, if any) and will not be
>>> decorated.
>>
>> In tapestry-core InternalModule I found usages of that interface, where
>> you bind an interface class.
>> Looking at the code, the implementation will try to resolve the
>> implementation class and then bind
>> it using the standard bind(Class<T> serviceInterface, Class<? extends T>
>> implementationClass) method.
>
> That part of the documentation talks about binding a service using only a
> concrete class and you're talking about binding a service using an
> interface, so the documentation is correct, maybe just not clear enough.
>
> Again, please post in the Tapestry user mailing list before posting a
> JIRA.
>
> Cheers!
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


This is what I stated in the _improvement request_: the existing
documentation on the method is lacking the extra information that one can
also go and bind services using a service interface class alone and that
tapestry will try to resolve the implementation class all by itself, by
appending the prefix 'Impl' to the service interface class' name. In that
case, it will redirect to bind(iface, impl), which in turn will allow
proxies and decorators to that interface.

The existing documentation does only account for when registering concrete
implementation classes as services.

Cheers

Carsten


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