On 2010-01-18 15.55, Stanislav Muhametsin wrote:
I remember having similar situation in my project, where I wanted some
specific concern to be always last (or first? don't remember). At that
time, I would have been content with some way to specify order of
concerns right there at interface.

But maybe method-constraints are just the way for specifying which is
executed first?

How would that work? And with any method for defining first, what happens if two concerns are defined as being "first"? This is one of the trickier parts of concern ordering, as I see it.

Another way to do it is to use something like priorities, and simply sort concerns according to priorities. Most of the time you won't care and set "3" (on a scale from 1-5), but if you want to have it run early, then set it to 1. That might be a better way to deal with it. If we do something like that it also opens up for being able to declare concerns on the constraint, which would be nice.

And return-value constraints for what is executed last
before side-effects?

Not sure what you mean here. Can you describe more?


Regarding your problem - what about having method Boolean
isOperationValid(...), which would take Class<? extends Constraint<?,
?>> (or something like that) as parameter, and then instantiate the
constraint, run it and return result?

No, I'd prefer to have something like "Method[] validMethods(composite)", i.e. I don't want to ask separately for each method.

/Rickard

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

Reply via email to