polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: Java 8 use...
Date Tue, 30 Jun 2015 16:13:34 GMT
Thanks for sharing...

PlainComposite --> I like that name better. Any other suggestions instead
of TransientComposite?

Yes, with presence of Java 8 Stream and Functional APIs, I think the answer
is along the lines of what you have done.

module.values()  --> should probably return a Stream of "something", which
one can then do filter and other operations on.

I assume that OfTypes() is a hard coded method, and a filter() operation
would take its place in Java. Perhaps like this;

    .filter( value -> value.types().anyMatch( Task.class ) )
    .withTypes( Identity.class );

But my original point was on how close to this we are already...

Stan, it would be awesome if we could converge terminology as much as
possible, so if there are other things that you chose differently (for some
reason), it would be good to hear about them and discuss now.


On Tue, Jun 30, 2015 at 5:45 PM, Stanislav Muhametsin <
stanislav.muhametsin@kapsi.fi> wrote:

> On 30.6.2015 18:16, Niclas Hedhman wrote:
>> Ah! The full expansion of supertypes doesn't affect HasTypes#types() until
>> after the assembly declarations are completed. I should have realized that
>> up front.
>> domainLayer.values( hasTypes -> matchesAny(
>>      type -> Task.class.isAssignableFrom( type ), hasTypes.types() )
>> ).withMixins( Identity.class );
>> since Task is expected to be a 'hard' super type.
> Semi-OT, in Qi4CS (current name) the same is achieved with:
> Snippet          assembler
>             .ForExistingPlainComposite()
>             .OfTypes( typeof( Task ) )
>             .WithMixins( typeof( Identity ) );
> The "ForExistingPlainComposite" returns the same
> "CompositeAssemblyDeclaration" (IIRC this is same name as in Zest)
> interface as when declaring new composites with the "NewPlainComposite()"
> method.
> "PlainComposite" here is a Qi4CS term which roughly is same as
> "TransientComposite" in Zest.
> And "assembler" is architecture-neutral interface allowing the declaration
> of composites.
> Lately though, I also been thinking of exposing the composite declarations
> more directly, like the "values" in your snippet, Niclas.
> It would certainly bring more consistency between Qi4CS and Zest.

Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

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