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 (JIRA)" <ji...@apache.org> on 2012/06/08 22:16:22 UTC
[jira] [Created] (TAP5-1955) Documentation on
ServiceBinder#bind(Class implementationClass) is wrong/lacks extra
information
Carsten Klein created TAP5-1955:
-----------------------------------
Summary: Documentation on ServiceBinder#bind(Class<T> implementationClass) is wrong/lacks extra information
Key: TAP5-1955
URL: https://issues.apache.org/jira/browse/TAP5-1955
Project: Tapestry 5
Issue Type: Improvement
Components: tapestry-core
Affects Versions: 5.3.3
Reporter: Carsten Klein
Priority: Minor
The documentation on the above mentioned method states that
> 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.
Bound as such, the interface can both be proxied and decorated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] [Created] (TAP5-1955) Documentation on
ServiceBinder#bind(Class implementationClass) is wrong/lacks extra
information
Posted by Carsten Klein <ca...@axn-software.de>.
> 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
Re: [jira] [Created] (TAP5-1955) Documentation on
ServiceBinder#bind(Class implementationClass) is wrong/lacks extra
information
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
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