Element is also the nominal root of the UML 1.4 hierarchy.  It's not new for
UML 2.  The problem is that there are a number of types defined which have
no supertypes (the ones mentioned by Michiel), so there is no single root to
the type hierarchy.

Many of the places that now use isAModelElement() used to use isABase()
which was a recognizer for the root of the NSUML type hierarchy.  These
probably should have been converted to isAElement instead of
isAModelElement, but even that wouldn't have helped with the current
problem.

The proposed method name isAUMLElement() sounds fine.  I've added a little
bit of explanation to the Javadoc.  The one thing to be careful of when
converting things is that there's a lot of code that assumes that things
have names and those places need to use isAModelElement, not isAUMLElement.

Tom

> -----Original Message-----
> From: Bob Tarling [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 29, 2007 2:27 PM
> To: [email protected]
> Subject: Re: [argouml-dev] The meaning of 
> Model.getFacade().isAModelElement()
> 
> 
> How about isAUMLElement - I think Element is a UML2 class and 
> so it's meaning will be futureproof.
> 
> Bob.
> 
> 
> On 29/03/07, Michiel van der Wulp <[EMAIL PROTECTED]> wrote:
> > Hi All,
> >
> > Recently, I realised that in MDR not all UML objects are a 
> > ModelElement. These are ElementOwnership (does not exist in MDR), 
> > ElementResidence, ElementImport, TemplateParameter, 
> TemplateArgument, 
> > and the data types Multiplicity, MultiplicityRange, 
> Expression. This 
> > may be incorrect (see 4.5.2.27), but that is another discussion.
> >
> > In many places in ArgoUML's code, the function
> > Model.getFacade().isAModelElement(x) is used to determine if we are 
> > dealing with a UML object, and not with e.g. a Fig, null, or a 
> > Diagram.
> >
> > This is obviously wrong. Please try not to do this!
> >
> >
> > One example is UMLModelElementListModel2.setTarget(), which 
> makes it 
> > hard to create a proppanel for e.g. a ElementResidence.
> >
> > To ease solving this, can we create a function with the name 
> > "isAUMLObject" or "isAUMLClass" in the model subsystem? The latter 
> > would be similar to the existing "getUMLClassName". Or is there 
> > another idea?
> >
> > Regards,
> > Michiel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to