[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Precedence

adrian@jboss.org do-not-reply at jboss.com
Fri Jul 6 11:08:42 EDT 2007


"alesj" wrote : 
  | I changed the B into E, and left the other parts of the test unchanged.
  | OK? :-)
  | 

No that misses the whole point of the test.

A) inputs=test1 outputs=null
B) inputs=null outputs=null
C) inputs=null outputs=test1

It is actually irrelevant where (B) is compared to (A) or (C)

If it just used Ordered.COMPARATOR in the order above then (B) would
get in the way of the sorting.

What is relevant is that A inputs from C, so the correct orders is either
1) C, A, B
2) B, C, A
3) C, B, A

(3) is obviously wrong since C and B are unrelated by attachment
they should be ordered by Ordered.COMPARATOR
but either (1) or (2) is correct.

The test assumes the following heuristic (which was true of the old sort): 
"Favour the order in which deployers are deployed".

i.e. Since B was deployed after A and there is no reason why B should be
sorted in front of A, therefore it always remains after A.
i.e. (1) is the correct order.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061349#4061349

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061349



More information about the jboss-dev-forums mailing list