You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2015/12/16 06:56:17 UTC

Multiple @Concerns declaration of same class

It seems that in previous versions of Qi4j/Zest, it may have been possible
to declare the same Concern (and SideEffect) multiple times and it would
have been invoked multiple times.

This was detected in TransientAsClassTest, where if I added a Concern, then
it was found both as a declaration on the Composite as well as on the Mixin.

I have add a check that if the Concern/SideEffect is already declared, it
won't be declared again. Equality is defined by ConcernModel, which is just
the class name of the Concern.

Question; Is this the correct semantic behavior? It will be the "first"
Concern that remains, i.e. the "outer most" one.

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

Re: Multiple @Concerns declaration of same class

Posted by Niclas Hedhman <ni...@hedhman.org>.
oooookkk.... If you say so. It is a really simple change. It has been
committed and pushed.

On Wed, Dec 16, 2015 at 2:04 PM, Kent Sølvsten <ke...@gmail.com>
wrote:

> Agree they should be unique
>
> But you could consider replacing the existing instead.
>
> That way it opens the possibility in assembly to reorder concerns
> declared with annotations - or to insert a new concern between existing
> (change A,B to A,C,B)
>
> /Kent
>
> Den 16-12-2015 kl. 06:56 skrev Niclas Hedhman:
> > It seems that in previous versions of Qi4j/Zest, it may have been
> possible
> > to declare the same Concern (and SideEffect) multiple times and it would
> > have been invoked multiple times.
> >
> > This was detected in TransientAsClassTest, where if I added a Concern,
> then
> > it was found both as a declaration on the Composite as well as on the
> Mixin.
> >
> > I have add a check that if the Concern/SideEffect is already declared, it
> > won't be declared again. Equality is defined by ConcernModel, which is
> just
> > the class name of the Concern.
> >
> > Question; Is this the correct semantic behavior? It will be the "first"
> > Concern that remains, i.e. the "outer most" one.
> >
> > Cheer
>
>


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

Re: Multiple @Concerns declaration of same class

Posted by Kent Sølvsten <ke...@gmail.com>.
Agree they should be unique

But you could consider replacing the existing instead.

That way it opens the possibility in assembly to reorder concerns
declared with annotations - or to insert a new concern between existing
(change A,B to A,C,B)

/Kent

Den 16-12-2015 kl. 06:56 skrev Niclas Hedhman:
> It seems that in previous versions of Qi4j/Zest, it may have been possible
> to declare the same Concern (and SideEffect) multiple times and it would
> have been invoked multiple times.
>
> This was detected in TransientAsClassTest, where if I added a Concern, then
> it was found both as a declaration on the Composite as well as on the Mixin.
>
> I have add a check that if the Concern/SideEffect is already declared, it
> won't be declared again. Equality is defined by ConcernModel, which is just
> the class name of the Concern.
>
> Question; Is this the correct semantic behavior? It will be the "first"
> Concern that remains, i.e. the "outer most" one.
>
> Cheer