2009/3/7 Rickard Öberg <[email protected]>

> Adrian Sampaleanu wrote:
> > Hi all,
> >
> > I suppose you are probably aware of what's going on with AspectJ
> > development, but if not, this post might be interesting:
> >
> > http://www.nabble.com/%40DeclareMixin-support-td22378859.html
>
> Well, to add things like Named in Qi4j you would rather do it by simply
> having the Composite extend that interface:
> interface MyComposite extends Named, Composite {}
>
> This is just basic Composite Oriented Programming, and is not a feature
> but a principle.
>
> If you don't like having to add "Named" everywhere, I suggest doing a
> base interface which acts sort of like a pointcut:
> interface DomainObject extends Named {}
>
> interface MyComposite1 extends DomainObject, Composite {}
> interface MyComposite2 extends DomainObject, Composite {}
>
> If you now want to add ACL to all DomainObjects, change it to:
> interface DomainObject extends Named, ACL {}
>
> and both Composites will get it.
>
> This gets you very very far.
>
> We have, however, also talked about doing more dynamic mixin additions,
> in the thread about @Abilities, which solves point 2) in his blog post,
> as there can then be two methods with the same name, but since they
> belong to different interfaces they will do different things.
>
> I would like to also note that @DeclareMixins("SomeC*") is rather
> horrible. If you refactor SomeClass to AnyClass it will all of a sudden
> not be Named anymore. Yeuch...
>

yes I find all that pattern matching AOP hard to follow, such as:

   @Before("execution(* *.*(..)) && this(m)")

which is another example from the doc mentioned in that email...

type-safe mixins are much nicer!

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

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

Reply via email to