UML Abstract Class - Using Abstract Modifier

An abstract class in UML is a class that cannot be instantiated. It contains abstract operations (operations without body) whose behavior is defined in subclasses. This tutorial shows you how to set abstract modifiers to classes, attributes, and operations.

Software Ideas Modeler supports the abstract modifier in UML class diagrams for UML classes, attributes, and operations.

What is an Abstract Class in UML?

A UML abstract class is a class without any instances. It represents a common class for other derived subclasses. An abstract class can contain abstract and also non-abstract attributes and operations. A class that is not abstract cannot have any abstract fields (attributes, operations).

E.g. a class for Shape can be marked as abstract. It cannot be instantiated because we do not know what kind of shape it represents. It is a base (super) class for other shape classes (e.g. Ellipse, Rectangle).

UML abstract class vs. instantiable (non-abstract) class
UML abstract class vs. instantiable (non-abstract) class

Abstract Attribute

An abstract attribute is used to model an abstract property. The specific properties that can return an actual value are defined by subclasses using non-abstract attributes.

Abstract attributes are rendered as italic in UML.

Abstract Operation

An abstract operation models an abstract method in UML. It is also rendered in italic. The abstract operations do not have any logic defined. The concrete operations in the non-abstract subclasses define the behavior that is omitted in respective bodiless abstract operations.

Create a UML Abstract Class

You can set the abstract modifier for a UML class in one of these ways:

1. Right-click on the class and choose Modifiers/Abstract from the context menu.

2. Open the Model tab in the Element context tab group and check the Abstract checkbox in the Modifiers group.

3. Double-click on the class, Properties dialog shows, check the Abstract checkbox in the Modifiers group, and confirm the choice using the OK button.

Create an Abstract Attribute or Operation

You can set the abstract modifier for an attribute or an operation in one of these ways:

1. Right-click on the attribute/operation and choose Modifiers/Abstract from the context menu.

2. Open the Model tab in the Field context tab group and check the Abstract checkbox in the Modifiers group.

3. Right-click on the attribute/operation and choose Properties from the context menu, Properties dialog shows, check the Abstract checkbox in the Modifiers group, and confirm the choice using the OK button.

Set Abstract modifier to UML class and operations
Set Abstract modifier to UML class and operations

Comments

Gezagn Bekele 10 August 2021 10:27:15

fundamental of software engineering

that is good I want to say continue.

New Comment

Comment