You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by Tyson Condie <tc...@gmail.com> on 2018/06/19 18:26:50 UTC

Tang question

Hi,

I came across an interface signature that did not make sense to me. In
ConfigurationModuleBuilder (Tang), the bindNamedParameter methods allow
bindings to Impl:

public final <T> ConfigurationModuleBuilder bindNamedParameter(
    final Class<? extends Name<T>> iface, final Impl<? extends T> opt) {

I have solely be using bindImplementation for such bindings, and would
assume that bindNamedParameter should (in concert) only allow bindings to
Param.

Could someone please explain why bindNamedParameter allows bindings to Impl
implementations? Also, It looks like bindImplementation (correctly) does
not include a method to bind to Param implementations.

Thanks,
Tyson

p.s., Rusty I Bcc'ed you in case you didn't want the email I had for you
out in the open.

Re: Tang question

Posted by Sergiy Matusevych <se...@gmail.com>.
Yes, this is very confusing indeed. E.g. in
org.apache.reef.driver.task.TaskConfiguration we bind some implementations
using .bindImplementation(), and others using .bindNamedParameter().

P.S. Quick search over java code base shows that there are only a few
places where we use .bindNamedParameter() to bind the implementation. It
shouldn't be too hard to fix it.

Thank you,
Sergiy.

On Tue, Jun 19, 2018 at 11:26 AM Tyson Condie <tc...@gmail.com>
wrote:

> Hi,
>
> I came across an interface signature that did not make sense to me. In
> ConfigurationModuleBuilder (Tang), the bindNamedParameter methods allow
> bindings to Impl:
>
> public final <T> ConfigurationModuleBuilder bindNamedParameter(
>     final Class<? extends Name<T>> iface, final Impl<? extends T> opt) {
>
> I have solely be using bindImplementation for such bindings, and would
> assume that bindNamedParameter should (in concert) only allow bindings to
> Param.
>
> Could someone please explain why bindNamedParameter allows bindings to Impl
> implementations? Also, It looks like bindImplementation (correctly) does
> not include a method to bind to Param implementations.
>
> Thanks,
> Tyson
>
> p.s., Rusty I Bcc'ed you in case you didn't want the email I had for you
> out in the open.
>