chernevik
chernevik

Reputation: 4000

UML View to "Roll Up" A Class's Inherited Methods?

Do UML tools have some summary view that show a class object's attributes and methods, including those obtained from parent classes through inheritance?

For example, say I have diagrammed foobar's inheritance from foo (Python code):

class foo:
  def doSomething(self):
     print 'stuff'

class foobar(foo):
   def dontJustStandThere(self):
       self.doSomething()

The foobar diagram shows inheritance from foo, and method dontJustStandTherE(). The foo diagram shows method doSomething(). Now, instantiated foobar objects will have two methods -- dontJustStandThere(), and doSomething() (by inheritance). It would be nice to see a summary of foobar that just listed its methods and attributes, without breaking those down into their specific sources, and ideally ignoring parent class methods overloaded by subclasses. Such accumulation of methods into one object is one point of inheritance, yes?

Do UML tools have such a view, and what do they call it? I've looked around the guide and commands for the tool I'm using (Poseidon), and the web, and I don't seem to see anything like this -- but it seems so useful that I imagine it's there somehow.

(I suppose it's also possible that Poseidon is focused on Java code, and that differences in Java's specification for inheritance from Python's might be complicating things.)

Upvotes: 0

Views: 544

Answers (3)

Jim L.
Jim L.

Reputation: 6529

UML 2.5 introduces a caret notation (e.g., ^ someAttribute: String) that allows you to show inherited members. Hopefully UML tools will support this notation soon.

Upvotes: 0

John Saunders
John Saunders

Reputation: 161801

Sparx Enterprise Architect does. You select the desired elements and choose the Feature Visibility command, and you can select whether inherited attributes and/or operations are visible:

alt text

Upvotes: 0

Jordi Cabot
Jordi Cabot

Reputation: 8228

In MagicDraw, when clicking on the properties on a class you see (in different boxes) at the same time the own properties of the object and inherited ones (and you can even change them, which updates the superclass owning the property)

Upvotes: 1

Related Questions