Hi,

Now that I have added specification-based declarations in ModuleAssembly, it makes sense to do the same in LayerAssembly. To some extent this replaces the need for the visitor-based support in LayerAssembly.

Whereas before you might use this:
<ThrowableType extends Throwable> void visit( AssemblyVisitor<ThrowableType> visitor )
        throws ThrowableType;
--
To find some service and mark it as Visibility.application, for example, now we could allow the assemblers to instead do this:
layerAssembly.services(AssemblySpecifications.types(MyService.class)).visibleIn(Visibility.application);

It would basically find all services in all modules in the layer with type MyService.class and mark it as Visibility.application. This makes it easy to apply rules like that.

Similarly, let's say you want to add a particular concern to all domain entities in the layer. Instead of registering them on all separate entities you can instead do:
layerAssembly.entities(types(Entity.class)).withConcerns(MyConcern.class);

Which is quite handy. The question is: is there any need that the visitor-method fulfills that would not be handled by such specification/declaration style methods? Do you guys have any examples?

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to