Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » DerivedSubsetEList won't be generated
DerivedSubsetEList won't be generated [message #478656] Fri, 31 July 2009 09:41 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
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 #479326 is a reply to message #478656] Mon, 10 August 2009 17:05 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
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 #479520 is a reply to message #479326] Tue, 11 August 2009 12:15 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
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 18:29 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
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 17:05 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
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 12:15 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
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 18:29 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
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}
Previous Topic:UML2Ecore convertion
Next Topic:Ecore from UML
Goto Forum:
  


Current Time: Thu Apr 25 21:14:43 GMT 2024

Powered by FUDForum. Page generated in 0.03202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top