Hi,

On Fri, Feb 13, 2009 at 10:48 AM, Rickard Öberg <[email protected]> wrote:
> Hey,
>
> I have now added support for assembly visitors. These can be used to
> perform assembly operations based on the visitor pattern.
>
> One example, in combination with the new contextual modifiers, would be
> to "Apply TraceConcern to all Composites in the Application", which
> could be implemented as:
> public void assemble(ModuleAssembly module)
> {
>   module.layerAssembly().applicationAssembly().visit( new
> AssemblyVisitorAdapter()
>   {
>     public void visitComposite( CompositeDeclaration declaration )
>     {
>       declaration.withConcerns( TraceConcern.class );
>     }
>   }
> }
> --
> There are visit* methods for all kinds of declarations, and the visitor
> also gets callbacks for each level of assembly that is visited. The
> AssemblyVisitorAdapter implements all methods so that it is easy to
> create subclasses which only override one or a few methods.
>

Yes, it is nice.

It is possible for Qi4J lib API to include default/adapter
Implementation of the visitor API, to avoid reinventing the wheel for
common case. Currently as I am aware it only have interface, which we
need to implement, However good DefaultAdapter implementation as part
of the library would be nice to have so each developer (for common
case) does not need to reinvent the wheel to implement those
interfaces again and again. Just use default adapter implementation
unless specific case is required.

Cheers
Tonny Kohar
--
KIYUT
imagine, design, create ...
http://www.kiyut.com

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

Reply via email to