polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Merlin <paulmer...@apache.org>
Subject Re: SingletonAssembler with lambda
Date Sat, 13 May 2017 14:54:29 GMT
+1

Niclas Hedhman a écrit :
> Gang,
>
> I think that the SingletonAssembler setup should use a lambda in the
> constructor instead of anonymous class.
>
> Today we write,
>
> SingletonAssembler singletonAssembler = new SingletonAssembler()
> {
>     @Override
>     public void assemble( ModuleAssembly module )
>         throws AssemblyException
>     {
>         module.values( SayWhere.class );
>     }
> };
>
>
> But I would like to change it to...
>
> SingletonAssembler singletonAssembler = new SingletonAssembler(
>     module ->
>     {
>         module.values( SayWhat.class );
>     }
> );
>
>
> We can keep the old style as well, and what is "sacrificed" is that the
> SingletonAssembler becomes a non-abstract class and the "implement methods"
> INTENT in IDEA (others?) is not there automatically. I think this is worth
> the change.
>
>
> WDYAT?
>
>
> Cheers

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message