SainTiss wrote:

Hi all,

I was trying to get to a Classifier's package, which in the UML metamodel comes down 
to navigating the namespace<->ownedElements association. However, calling 
getNamespace() on a modelElement returns null, because of what looks like a bug to me:

in ModelElementFacadeLogicImpl, the shieldedElement is a UmlPackage (which is 
fine, because it should be). The facade which is constructed, is thus a 
UmlPackageFacade. However, then it is cast into a NamespaceFacade, which fails 
because the MagicDraw UML Metamodel from which the facades are generated, does 
not have a generalization relationship between namespaces and packages in any 
way.

Why is there a deviation from the official UML metamodel here? Is this for 
reasons of convenience?

In my opinion, one of two things should be done here:
- connect namespace and package via generalizations
- make sure the namespace<->ownedElements association is not navigable in the 
direction of namespace

I found out that there is a getPackage() method on ModelElements which will fetch the package an element is in, but I feel that either getNamespace() should work too, or should be eliminated...


You're right: it looks like getNamespace() should be removed, I think it was used at one point, but I don't think its being used anymore, I'll take a closer look and remove it if that's the case...thanks for the heads up.

Thanks,

Hans





------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Andromda-user mailing list Andromda-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to