UML Diagrams Zicomi Systems publishes some UML example diagrams online from the world famous UML dictionary. more...
Version 2.5 Released Zicomi Systems is delighted to announce that version 2.5 of Zicomi Mentor is released. With support for UML 2.0 and all thirteen UML diagrams more...
Zicomi Systems' Director speaks about the UML at Objects by Design - an informative interview more...
Partner Programme Zicom Systems is delighted to announce a new world wide partner programme, become a partner today. more...
OMG Member Zicom Systems is made a member of the OMG!
Abstract Class
An abstract class is a class that cannot be directly instantiated. . It cannot have attributes or methods and but can contain abstract operations. It is semantically equivalent to an interface, and can participate in relationships such as generalization dependencies, and association with some restrictions.
Explanation
An abstract class is a type of class that can be identified by its italicized name and operations. It can be used to give a formal specification of the services of the class without specifying the way the services are provided. An abstract class cannot have attributes and is said to be abstract because it cannot have direct instances. This means that a class instance (object) can never be a direct instance of an abstract class. A class instance (object) may be an indirect instance in that it may be an instance of a sub-class (child) of the abstract class. In this circumstance the sub-class will have "concrete" operations. It is equivalent to an interface and has the same relationships and restrictions of an interface.
Important Points
All operations must be abstract
The operation compartment contains an ordered list of operations usually one to a line all of which must be abstract.
An abstract class cannot have attributes
An abstract class cannot contain attributes, nor can it have direct instances. They can participate in relationships like any class, however there are some restrictions in the way these relationships are applied.
A class is related to an abstract class in that they have similar semantics. The abstract class is more restrictive than a class and does not allow attributes The operations are different to those of a class, in the sense that they are abstract and cannot have methods.