Home » Modeling » UML2 » DerivedSubsetEList won't be generated
DerivedSubsetEList won't be generated [message #478656] |
Fri, 31 July 2009 05:41  |
Eclipse User |
|
|
|
Hi all,
i'm using the UML2 genmodel to generate an Ecore model, which is aware
of the UML2 subsets mechanism. This works well for the most parts of my
model, but i was wondering why a derived subset wasn't generate the
DerivedSubsetEList. By manually defining the relation, it works as
expected, but it won't be generated.
Is this the intended behavior?
Thanks
{Timothy}
|
|
| |
Re: DerivedSubsetEList won't be generated [message #479520 is a reply to message #479326] |
Tue, 11 August 2009 08:15   |
Eclipse User |
|
|
|
Kenn,
of course... again, i refer to the Package::ownedTypes containment of
Figure 7.14 in the UML2 spec.
When i generate the corresponding code, it looks like this:
public EList<Type> getOwnedTypes() {
// TODO: implement this method to return the 'Owned Type' reference list
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
but it should look like this:
public EList<Type> getOwnedTypes() {
return new DerivedSubsetEObjectEList<Type>(Type.class, this,
TestingPackage.PACKAGE__OWNED_TYPE, OWNED_TYPE_ESUPERSETS);
}
Well, it was not hard to implement this if you understand how the UML
list framework works, but i was wondering, why the generator is not
capable to generate it. Almost any information, that is necessary, is
avialable in the model, i think.
Thx
Timothy
Kenn Hussey schrieb:
> Timothy,
>
> I'm afraid you'll have to provide a bit more detail about your model in
> order for us to help. What do you mean by "manually defining the relation"?
>
> Note that code using derived subset lists will generally only be
> generated if the subset is derived and the option to process subsets is
> turned on in the wizard...
>
> Kenn
>
> Timothy Marc wrote:
>> Hi all,
>>
>> i'm using the UML2 genmodel to generate an Ecore model, which is aware
>> of the UML2 subsets mechanism. This works well for the most parts of
>> my model, but i was wondering why a derived subset wasn't generate the
>> DerivedSubsetEList. By manually defining the relation, it works as
>> expected, but it won't be generated.
>> Is this the intended behavior?
>>
>> Thanks
>> {Timothy}
|
|
|
Re: DerivedSubsetEList won't be generated [message #485449 is a reply to message #479520] |
Fri, 11 September 2009 14:29  |
Eclipse User |
|
|
|
Timothy,
I think it is reasonable to expect that this case be automatically
supported by the generator, but in fact the subsets constraint (alone)
in UML doesn't provide enough information to do so - there's nothing
about a subsets constraint that indicates _how_ elements are chosen to
be part of the subset. In many (most?) cases, if both the superset and
subset properties are composite, the subset is probably just a type
restriction (as it is in this case), but I'm not sure how safe this
assumption is in general...
Kenn
Timothy Marc wrote:
> Kenn,
>
> of course... again, i refer to the Package::ownedTypes containment of
> Figure 7.14 in the UML2 spec.
>
> When i generate the corresponding code, it looks like this:
>
> public EList<Type> getOwnedTypes() {
> // TODO: implement this method to return the 'Owned Type' reference
> list
> // Ensure that you remove @generated or mark it @generated NOT
> throw new UnsupportedOperationException();
> }
>
> but it should look like this:
>
> public EList<Type> getOwnedTypes() {
> return new DerivedSubsetEObjectEList<Type>(Type.class,
> this, TestingPackage.PACKAGE__OWNED_TYPE, OWNED_TYPE_ESUPERSETS);
> }
>
> Well, it was not hard to implement this if you understand how the UML
> list framework works, but i was wondering, why the generator is not
> capable to generate it. Almost any information, that is necessary, is
> avialable in the model, i think.
>
> Thx
> Timothy
>
>
> Kenn Hussey schrieb:
>> Timothy,
>>
>> I'm afraid you'll have to provide a bit more detail about your model
>> in order for us to help. What do you mean by "manually defining the
>> relation"?
>>
>> Note that code using derived subset lists will generally only be
>> generated if the subset is derived and the option to process subsets
>> is turned on in the wizard...
>>
>> Kenn
>>
>> Timothy Marc wrote:
>>> Hi all,
>>>
>>> i'm using the UML2 genmodel to generate an Ecore model, which is
>>> aware of the UML2 subsets mechanism. This works well for the most
>>> parts of my model, but i was wondering why a derived subset wasn't
>>> generate the DerivedSubsetEList. By manually defining the relation,
>>> it works as expected, but it won't be generated.
>>> Is this the intended behavior?
>>>
>>> Thanks
>>> {Timothy}
|
|
|
Re: DerivedSubsetEList won't be generated [message #627861 is a reply to message #478656] |
Mon, 10 August 2009 13:05  |
Eclipse User |
|
|
|
Timothy,
I'm afraid you'll have to provide a bit more detail about your model in
order for us to help. What do you mean by "manually defining the relation"?
Note that code using derived subset lists will generally only be
generated if the subset is derived and the option to process subsets is
turned on in the wizard...
Kenn
Timothy Marc wrote:
> Hi all,
>
> i'm using the UML2 genmodel to generate an Ecore model, which is aware
> of the UML2 subsets mechanism. This works well for the most parts of my
> model, but i was wondering why a derived subset wasn't generate the
> DerivedSubsetEList. By manually defining the relation, it works as
> expected, but it won't be generated.
> Is this the intended behavior?
>
> Thanks
> {Timothy}
|
|
|
Re: DerivedSubsetEList won't be generated [message #627865 is a reply to message #479326] |
Tue, 11 August 2009 08:15  |
Eclipse User |
|
|
|
Kenn,
of course... again, i refer to the Package::ownedTypes containment of
Figure 7.14 in the UML2 spec.
When i generate the corresponding code, it looks like this:
public EList<Type> getOwnedTypes() {
// TODO: implement this method to return the 'Owned Type' reference list
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
but it should look like this:
public EList<Type> getOwnedTypes() {
return new DerivedSubsetEObjectEList<Type>(Type.class, this,
TestingPackage.PACKAGE__OWNED_TYPE, OWNED_TYPE_ESUPERSETS);
}
Well, it was not hard to implement this if you understand how the UML
list framework works, but i was wondering, why the generator is not
capable to generate it. Almost any information, that is necessary, is
avialable in the model, i think.
Thx
Timothy
Kenn Hussey schrieb:
> Timothy,
>
> I'm afraid you'll have to provide a bit more detail about your model in
> order for us to help. What do you mean by "manually defining the relation"?
>
> Note that code using derived subset lists will generally only be
> generated if the subset is derived and the option to process subsets is
> turned on in the wizard...
>
> Kenn
>
> Timothy Marc wrote:
>> Hi all,
>>
>> i'm using the UML2 genmodel to generate an Ecore model, which is aware
>> of the UML2 subsets mechanism. This works well for the most parts of
>> my model, but i was wondering why a derived subset wasn't generate the
>> DerivedSubsetEList. By manually defining the relation, it works as
>> expected, but it won't be generated.
>> Is this the intended behavior?
>>
>> Thanks
>> {Timothy}
|
|
|
Re: DerivedSubsetEList won't be generated [message #627938 is a reply to message #479520] |
Fri, 11 September 2009 14:29  |
Eclipse User |
|
|
|
Timothy,
I think it is reasonable to expect that this case be automatically
supported by the generator, but in fact the subsets constraint (alone)
in UML doesn't provide enough information to do so - there's nothing
about a subsets constraint that indicates _how_ elements are chosen to
be part of the subset. In many (most?) cases, if both the superset and
subset properties are composite, the subset is probably just a type
restriction (as it is in this case), but I'm not sure how safe this
assumption is in general...
Kenn
Timothy Marc wrote:
> Kenn,
>
> of course... again, i refer to the Package::ownedTypes containment of
> Figure 7.14 in the UML2 spec.
>
> When i generate the corresponding code, it looks like this:
>
> public EList<Type> getOwnedTypes() {
> // TODO: implement this method to return the 'Owned Type' reference
> list
> // Ensure that you remove @generated or mark it @generated NOT
> throw new UnsupportedOperationException();
> }
>
> but it should look like this:
>
> public EList<Type> getOwnedTypes() {
> return new DerivedSubsetEObjectEList<Type>(Type.class,
> this, TestingPackage.PACKAGE__OWNED_TYPE, OWNED_TYPE_ESUPERSETS);
> }
>
> Well, it was not hard to implement this if you understand how the UML
> list framework works, but i was wondering, why the generator is not
> capable to generate it. Almost any information, that is necessary, is
> avialable in the model, i think.
>
> Thx
> Timothy
>
>
> Kenn Hussey schrieb:
>> Timothy,
>>
>> I'm afraid you'll have to provide a bit more detail about your model
>> in order for us to help. What do you mean by "manually defining the
>> relation"?
>>
>> Note that code using derived subset lists will generally only be
>> generated if the subset is derived and the option to process subsets
>> is turned on in the wizard...
>>
>> Kenn
>>
>> Timothy Marc wrote:
>>> Hi all,
>>>
>>> i'm using the UML2 genmodel to generate an Ecore model, which is
>>> aware of the UML2 subsets mechanism. This works well for the most
>>> parts of my model, but i was wondering why a derived subset wasn't
>>> generate the DerivedSubsetEList. By manually defining the relation,
>>> it works as expected, but it won't be generated.
>>> Is this the intended behavior?
>>>
>>> Thanks
>>> {Timothy}
|
|
|
Goto Forum:
Current Time: Sun Jul 27 13:41:21 EDT 2025
Powered by FUDForum. Page generated in 0.25121 seconds
|