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.
A concrete class is a subclass of an abstract class, which implements all its abstract method. Abstract methods cannot have body. Abstract class can have static fields and static method, like other classes.
Abstract methods are displayed by italic text (UML has a boolean value for this). The notation you are using is called Keyword (simple way) or Stereotype (more complex).
Abstract class can have both an abstract as well as concrete methods. A concrete class can only have concrete methods. Even a single abstract method makes the class abstract. Abstract class can not be instantiated using new keyword.
An abstract method doesn't have any implementation (method body). A class containing abstract methods should also be abstract. We cannot create objects of an abstract class. To implement features of an abstract class, we inherit subclasses from it and create objects of the subclass.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With