[cdi-dev] Challenge TCK test for indirect specialization rules

Matus Abaffy maabaffy at redhat.com
Tue Jun 10 06:39:38 EDT 2014


----- Original Message -----
> From: "Jozef Hartinger" <jharting at redhat.com>
> To: "Matus Abaffy" <maabaffy at redhat.com>, "Mark Struberg" <struberg at yahoo.de>
> Cc: cdi-dev at lists.jboss.org
> Sent: Friday, June 6, 2014 10:17:31 AM
> Subject: Re: [cdi-dev] Challenge TCK test for indirect specialization rules
> 
> 
> On 06/03/2014 11:48 AM, Matus Abaffy wrote:
> > If the intention was not to ignore the beans in-between, then the rule for
> > indirect specialization seems quite redundant to me.
> 
> The way indirect specialization is defined in the spec is equivalent to
> saying that "specialization" relation is transitive. Having
> 
> A specializes B
> and
> B specializes C
> 
> that means that also
> "A specializes C"
> holds true.
> 
> I agree that when looking at qualifiers and name only, this "A
> specializes C" relation may seem redundant. Relations "A specializes B"
> and "B specializes C" themselves guarantee
> that B contains all the qualifiers of C, A contains all the qualifiers
> of B (and thus also those from C).
> 
> However, there are other parts of the specification for which the fact
> that both "A specializes B" and "A specializes C" hold true is
> important.

Yes, of course, I am aware of these. I kind of misexpressed myself.
What I wanted to say is that the indirect specialization is redundantly
contained in "Then X will inherit the qualifiers and bean name of Y:".
I think the following suffices:
'If X directly specializes Y, then X will inherit the qualifiers and bean name of Y:'

>For example, take section 5.1.2.
> It says:
> 
> "A bean is said to be enabled if it is not specialized by any other
> enabled bean".
> 
> Now it makes a difference whether we consider specialization transitive
> (A specializes C relation exists) or not as it influences whether C ends
> up being enabled or not.
> 
> Transitive case:
> Both B and C are specialized by A and thus only A remains enabled.
> 
> Non-transitive case:
> A is enabled. B is specialized by A this B is not enabled. C is only
> specialized by B, which is *not enabled* thus C remains enabled. Now
> having both A and C enabled at the same time is clearly wrong and goes
> against the whole purpose of specialization. Instead of replacing C with
> A we end up we both beans enabled.
> 
> I think there is no doubt now that non-transitive specialization does
> not fit the CDI spec. In addition, I hope this makes it clear why
> transitivity of specialization is not redundant.
> 
> Jozef
> 


More information about the cdi-dev mailing list