Question

I'm drawing some UML in which a concrete class inherits from an abstract class which defines a pure virtual method. Is it required to show this method in the concrete class as well? It's implied by inheriting from the abstract class.

Was it helpful?

Solution

Nope, you don't need to. in fact, in general, don't put any more in the UML than you must have to clarify what you're saying, unless you're (god forbid) trying to generate code from it.

The best guide I know of for UML is UML Distilled by Martin Fowler.

OTHER TIPS

The funny thing about UML is that it has a pretty loose and varied definition. Most things that are called UML are actually not much more that block diagrams. There is a lot of ambiguity in any UML implementation.

I would say that if you are doing this for a presentation or architectural diagram, you can take care of a lot of the possible ambiguity with 'words'. If you will be generating code from it using some application, you should check the docs of that particular application.

It's implied and in fact, many CASE tools would show you the inherited method as part of the list of the methods of the subclass when clicking on the class at looking at its properties (and some CASE tools even have the option of showing also the inherited methods in the diagram)

I just found this link, and it looks like you do :/

http://java-x.blogspot.com/2007/01/implementing-visitor-pattern-in-java.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top