|
Re: Body of the subtypes [message #28153 is a reply to message #28095] |
Fri, 15 June 2007 09:57   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Jibran,
The "constrained operation" in both of these cases should be the same,
because I suppose that superToString() actually only has one definition,
and that is in the SuperA class. What distinguishes the two constraints is
that they have different *context classifiers.*
Inspecting the Constraints created by the parser, you should see the
following:
- in the first case:
- constrainedElement references the Sub1OfA class and the
SuperA.superToString() operation (context classifier is Sub1OfA)
- specification contains an ExpressionInOCL in which:
- contextVariable is a Variable whose type is Sub1OfA (this is the
"self" variable)
- in the second case:
- constrainedElement references the Sub2OfA class and the
SuperA.superToString() operation (context classifier is Sub2OfA)
- specification contains an ExpressionInOCL in which:
- contextVariable is a Variable whose type is Sub2OfA (this is the
"self" variable)
If you don't see this, then the parser has a bug.
Cheers,
Christian
A. Jibran Shidqie wrote:
> Hi,
>
> We found out that in the results of the parsing process of the overwriting
> operation of Body expression, the OCL parser returns the operation context
> of its supertype. To make things clear, we'll give the example. The
> following OCL input is parsed : (the ecore model is attached)
>
> --------------------
> package example
>
> context Sub1OfA::superToString() : String
> body : 'result of Sub1OfA'
>
> context Sub2OfA::superToString() : String
> body : 'result of Sub2OfA'
>
> endpackage
> ---------------
>
> For each expression above, it results the same operation context, the
> operation of their superclass (SuperA).
> Can we have difference result context for each subtypes expression? In
> this case the 1st expression would have the operation context which its
> container is itself instead of its superclass, and so as the 2nd
> expression.
>
> Best regards,
> Jibran
|
|
|
Re: Body of the subtypes [message #28191 is a reply to message #28153] |
Mon, 18 June 2007 05:03  |
Eclipse User |
|
|
|
Hi Christian,
Yes, we saw it. It works perfectly well :)
Thanks again
Best regards,
Jibran
"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f4u5sg$fab$1@build.eclipse.org...
> Hi, Jibran,
>
> The "constrained operation" in both of these cases should be the same,
> because I suppose that superToString() actually only has one definition,
> and that is in the SuperA class. What distinguishes the two constraints
> is
> that they have different *context classifiers.*
>
> Inspecting the Constraints created by the parser, you should see the
> following:
>
> - in the first case:
> - constrainedElement references the Sub1OfA class and the
> SuperA.superToString() operation (context classifier is Sub1OfA)
> - specification contains an ExpressionInOCL in which:
> - contextVariable is a Variable whose type is Sub1OfA (this is the
> "self" variable)
> - in the second case:
> - constrainedElement references the Sub2OfA class and the
> SuperA.superToString() operation (context classifier is Sub2OfA)
> - specification contains an ExpressionInOCL in which:
> - contextVariable is a Variable whose type is Sub2OfA (this is the
> "self" variable)
>
> If you don't see this, then the parser has a bug.
>
> Cheers,
>
> Christian
>
>
> A. Jibran Shidqie wrote:
>
>> Hi,
>>
>> We found out that in the results of the parsing process of the
>> overwriting
>> operation of Body expression, the OCL parser returns the operation
>> context
>> of its supertype. To make things clear, we'll give the example. The
>> following OCL input is parsed : (the ecore model is attached)
>>
>> --------------------
>> package example
>>
>> context Sub1OfA::superToString() : String
>> body : 'result of Sub1OfA'
>>
>> context Sub2OfA::superToString() : String
>> body : 'result of Sub2OfA'
>>
>> endpackage
>> ---------------
>>
>> For each expression above, it results the same operation context, the
>> operation of their superclass (SuperA).
>> Can we have difference result context for each subtypes expression? In
>> this case the 1st expression would have the operation context which its
>> container is itself instead of its superclass, and so as the 2nd
>> expression.
>>
>> Best regards,
>> Jibran
>
|
|
|
Powered by
FUDForum. Page generated in 0.43927 seconds