[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.uml2] Re: DerivedSubsetEList won't be generated

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}