Quoting Rickard Öberg <[email protected]>:
Correct, I was talking about the Concern I used as an implementation
of the constraint check. That needs to be at the "top".
Aah, I see. Makes sense.
Interesting side-question: would that order be modifiable in runtime then?
Nope. That would be a nightmare I think...
Indeed. But imagine how customizable system would be, if you would
figure out the easily usable and implementable way to do that. :D If
only human resources were infinite... ;)
I would prefer if the concern implementor is the one that decides,
but the application assembler can certainly have other opinions. Not
sure how to handle that. To begin with setting priority on the
concern itself should be good enough.
If prioritizing concerns is the way to do it, yeah. For application
assembler to affect things, there is one alternative that I just came
up with. It may be used also with combination of prioritizing, and it
would involve adding some sort of hook to XXXDeclaration. The hook
would be something like this:
interface ConcernOrderHook
{
int getNextConcern(Class compositeClass, List<ConcernDeclaration>
unassignedConcerns);
}
It would return index for concern, which should be put next in
concern-invocation-chain. Thus the order of the chain would be
controlled by application assembler (or by whoever controls the
application assembler itself), and would be used whenever the chain is
constructed.
Not sure how prioritizing would fit into this - maybe don't ask from
the ConcernOrderHook if priority of concern is strong enough (ie
implementator of concern wants it to be SPECIFICALLY in some place).
Totally forgot about caching, hehe. Not sure how 'clean' or 'qi4j'stic
way that is, but that's the first one i could think of to your specific
case.
We have a couple more such caches. For example, when you look up a
builder given a class type that resolution is cached, as it never
changes. Look at all the *Finder classes in the runtime.
Gotta check sometime. Awfully busy with writing process of MSc thesis
at this moment, that's why it took me so long to write this
proposition in a first time from our last conversation. :)
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev