Unified Modeling Language
Unified modeling language (UML) references and diagrams are common when dealing with JAVA programming. UML is used to describe the relationship between objects. For instance, in the section about classes class relationships were described such that three possible object relationships are:
- A-kind-of - The A-kind-of relationship is a classic relationship such as a sports car is a kind of car, or a Ford mustang is a kind of a car. This refers from the specific (type of car) to general (car) description. This is a general description of the subclass to parent class relationship. This relationship is shown with an arrow pointing from the sub class to the parent class.
- Part-of - This relationship is of the type described above where a car is composed of specific parts. This refers from the subclass to the parent or superclass. An engine is part of a car. This relation in the reverse of the "Has-a" relationship, below. It is indicated using a solid diamond as described below.
- Has-a - This is the inverse of the part-of relationship and refers from the parent or superclass to the subclass. A car has an engine. This concept is called aggregation or composition and is designated by a filled diamond at the containing class in the Unified Modeling Language (UML).
Objects are shown as boxes with up to three sections. The sections are:
- Type of object (class name)
- Data members important enough to list.
- Member functions. This is also called the interface since it is a list of functions used to "interface" the object to the outside world.
In the drawing below, the class "airplane" "has-an" engine and wings which is an aggregation or composition relationship. The "jetfighter" and the "ultralight" class are "a-kind-of" the class "airplane". The aggregation relationship is shown with a solid diamond, and the "a kind of" relation is shown with an arrow. Of course, the jetfighter and the ultralight class would use the keyword "extends" with the phrase "jetfighter extends airplane" when the class is declared to be a subclass of the airplane class. The engine and the wings class would be a part of the airplane class and be implemented inside the airplane class.