UML2 vs EMF generated code difference [message #626423] |
Thu, 17 April 2008 15:19 |
Eclipse User |
|
|
|
Hi,
I recently converted a meta model specified in EMF into a UML meta
model. When regenerating the code from the UML-ized model I noticed
changes in generated code for 'eInverseRemove' methods, and in some
cases they were completely absent.
After some investigation it turned out that UML code generator did not
generate case statements for derived features. Eventually I traced it
down to differences in GenFeatureFilter-s applied to
GenClassImpl.getEInverseRemoveGenFeatures method.
In EMF the filter's accept method looks like this:
public boolean accept(GenFeature genFeature)
{
return genFeature.isEffectiveContains() ||
(genFeature.isBidirectional() &&
(!genFeature.getReverse().isVolatile() ||
genFeature.getReverse().hasDelegateFeature())) ||
genFeature.isFeatureMapType();
}
while in UML2 it looks like this:
public boolean accept(GenFeature genFeature) {
return !genFeature.isDerived();
}
Why the different treatment of derived features in EMF and UML? Why is
it unacceptable to 'inverse remove' a derived feature in UML?
Thanks,
Vmir
|
|
|
Powered by
FUDForum. Page generated in 0.04520 seconds