Reputation: 529
now this is not directly a programming question, it's more a design question.
I am currently working on a cdi extension. this extension handles instances configured by
Now I can't decide on how to prioritize multiple available configurations e.g. which argument overrides which one..
(as an example) when there is an annotation with value on classlevel and at injection point, which config should be used? does the "smallest" (at injection point) annotation always win or the "largest" (vm argument)?
as this is supposed to grow into a framework i want to get this right.
for the approach "the smallest one always wins" i could foresee use cases where the framework user gets confused because a class- or memberlevel annotation overrides the config of a properties file in the classpath. kinda the same picture (only reversed) is painted by the other approach..
so this would be a rule which the framework user has to learn. which of the approaches is more intuitive?
just brainstorming ;)
greetings from germany
Upvotes: 0
Views: 92
Reputation: 5378
In DeltaSpike, and also CDI 1.1 (possibly more general in Java EE 7) the lowest number wins, at least from that standpoint it will be consistent.
Upvotes: 2