collection(T2) [message #47882] |
Fri, 11 January 2008 11:26 |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi All,
could somebody please explain me why in the OCL standard library
defined in MDT-OCL collect() operation returns result of type
collection(T2)?
I understand that collection(T2) indicates that its elements are of
different type than in the original collection(T).
I cannot perform any operation on the collect() resulting collection
(like for example collect(x)->sum() because in the standard library
collection(T2) has no operations defined.
Thanks in advance,
Krzysztof
|
|
|
Re: collection(T2) [message #47974 is a reply to message #47882] |
Fri, 11 January 2008 13:50 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
The T2 type in the stdlib implementation is a somewhat clumsy way to
represent the template parameter T2 in the OCL Specification's definition
of the collect() iterator.
Collection(T2) doesn't have to define operations of its own because it
inherits them from the basic Collection definition. How are you attempting
to parse/evaluate your expression? I have no difficult with expressions
such as
EClassifier.allInstances()->collect(name)->collect(size())- >sum()
Cheers,
Christian
Krzysztof Kaczmarski wrote:
> Hi All,
>
> could somebody please explain me why in the OCL standard library
> defined in MDT-OCL collect() operation returns result of type
> collection(T2)?
> I understand that collection(T2) indicates that its elements are of
> different type than in the original collection(T).
>
> I cannot perform any operation on the collect() resulting collection
> (like for example collect(x)->sum() because in the standard library
> collection(T2) has no operations defined.
>
> Thanks in advance,
> Krzysztof
|
|
|
Re: collection(T2) [message #48034 is a reply to message #47974] |
Fri, 11 January 2008 14:02 |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Hi Christian,
is this inheritance defied in oclstdlib.uml ?
I cannot see that.
Cheers,
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> The T2 type in the stdlib implementation is a somewhat clumsy way to
> represent the template parameter T2 in the OCL Specification's definition
> of the collect() iterator.
>
> Collection(T2) doesn't have to define operations of its own because it
> inherits them from the basic Collection definition. How are you attempting
> to parse/evaluate your expression? I have no difficult with expressions
> such as
>
> EClassifier.allInstances()->collect(name)->collect(size())- >sum()
>
> Cheers,
>
> Christian
>
> Krzysztof Kaczmarski wrote:
>
>> Hi All,
>>
>> could somebody please explain me why in the OCL standard library
>> defined in MDT-OCL collect() operation returns result of type
>> collection(T2)?
>> I understand that collection(T2) indicates that its elements are of
>> different type than in the original collection(T).
>>
>> I cannot perform any operation on the collect() resulting collection
>> (like for example collect(x)->sum() because in the standard library
>> collection(T2) has no operations defined.
>>
>> Thanks in advance,
>> Krzysztof
>
|
|
|
Re: collection(T2) [message #48123 is a reply to message #48034] |
Fri, 11 January 2008 18:16 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Krzysztof,
This is one of the peculiarities of the oclstdlib.{ecore,uml}
implementations, that these generalization relationships are not defined in
the library models, but instead are implemented in code. Ecore cannot
express generalizations between non-EClasses, and this structure was
reproduced in the UML representation because of the way that the parser
internally supplies the inheritance. This is one of several aspects of
these libraries that needs to be cleaned up in an eventual MDT OCL 2.0
release ...
Cheers,
Christian
Krzysztof Kaczmarski wrote:
> Hi Christian,
> is this inheritance defied in oclstdlib.uml ?
> I cannot see that.
>
> Cheers,
> Krzysztof
>
> Christian W. Damus wrote:
>> Hi, Krzysztof,
>>
>> The T2 type in the stdlib implementation is a somewhat clumsy way to
>> represent the template parameter T2 in the OCL Specification's definition
>> of the collect() iterator.
>>
>> Collection(T2) doesn't have to define operations of its own because it
>> inherits them from the basic Collection definition. How are you
>> attempting
>> to parse/evaluate your expression? I have no difficult with expressions
>> such as
>>
>> EClassifier.allInstances()->collect(name)->collect(size())- >sum()
>>
>> Cheers,
>>
>> Christian
-----8<-----
|
|
|
Re: collection(T2) [message #48154 is a reply to message #48123] |
Sat, 12 January 2008 08:55 |
Eclipse User |
|
|
|
Originally posted by: krzysztof_kaczmarski.o2.pl
Oh, so my own implementation of OCL will have to implement it
implicitly too.
Thanks for this clarification.
Krzysztof
Christian W. Damus wrote:
> Hi, Krzysztof,
>
> This is one of the peculiarities of the oclstdlib.{ecore,uml}
> implementations, that these generalization relationships are not defined in
> the library models, but instead are implemented in code. Ecore cannot
> express generalizations between non-EClasses, and this structure was
> reproduced in the UML representation because of the way that the parser
> internally supplies the inheritance. This is one of several aspects of
> these libraries that needs to be cleaned up in an eventual MDT OCL 2.0
> release ...
>
> Cheers,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian,
>> is this inheritance defied in oclstdlib.uml ?
>> I cannot see that.
>>
>> Cheers,
>> Krzysztof
>>
>> Christian W. Damus wrote:
>>> Hi, Krzysztof,
>>>
>>> The T2 type in the stdlib implementation is a somewhat clumsy way to
>>> represent the template parameter T2 in the OCL Specification's definition
>>> of the collect() iterator.
>>>
>>> Collection(T2) doesn't have to define operations of its own because it
>>> inherits them from the basic Collection definition. How are you
>>> attempting
>>> to parse/evaluate your expression? I have no difficult with expressions
>>> such as
>>>
>>> EClassifier.allInstances()->collect(name)->collect(size())- >sum()
>>>
>>> Cheers,
>>>
>>> Christian
>
> -----8<-----
|
|
|
Powered by
FUDForum. Page generated in 0.03232 seconds