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

Mark Struberg struberg at yahoo.de
Thu Jun 12 14:32:11 EDT 2014


And here we go doing a full cycle back to my initial statement.

From what I (and Pete as well) do remember, the reason for 4.3.1 is that it should behave different to what Jozef says. 
4.3.1 is not unnecessary bollocks but is worded that way because the 'intermediate' specialized bean is INTENTIONALLY left out of the equation.
This is why it is NOT unnecessary but indeed NEEDED and totally makes sense. 

And if you look at Weld 1.x then you will see that old Weld versions did EXACTLY work that way as well. 

LieGrue,
strub


On Tuesday, 10 June 2014, 12:39, Matus Abaffy <maabaffy at redhat.com> wrote:
 

>
>
>
>----- 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
>> 
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20140612/50667576/attachment.html 


More information about the cdi-dev mailing list