Study Cards on structure, abstract, book
A Structure Diagram IS A Diagram or
A Structure Diagram is a KIND OF (or SORT OF) Diagram or
A Structure Diagram is a specialization of a Diagram or
A Diagram is a generalization of Structure Diagram and Behavior Diagram or
Structure Diagrams and Behavior Diagrams are CHILDREN of Diagram or
A Diagram is a PARENT of Structure Diagram and Behavior Diagram
However, you can have each subclass use its own triangle, and the direction can be in any orientation, subject to considerations on readability.
In Fig. 10.29, we show an example of how inheritance works.
In Audio CD and Book, the two attributes (title and callNo) are repeated.
UML recommends using the caret (^) to precede inherited features to distinguish them from features that are native to the class.
We do not have to show an inherited feature at all.
For example:
we did not repeat borrow() on Audio Cd or Book, but it is there.
How do we show that this is a inherited feature?
We show that this feature is inherited in Adult Book by showing ^author:Person on the end of the association.
As previously discussed, we did not have to show these as the association would be inherited naturally.
We also added new attribute and operations on the Book subclasses.
Also, note that the role name at the Book end and the Adult Book end is not inherited. These are properties of Person.
If it cannot be found in the current subclass, the chain of superclasses above the subclass is examined to find the closest definition.
When the closest definition is the found, it is retrieved and used.
The UML specification does not explain what happens if the definition is never found as that is an implementation/language concern.
Equivalently, we can use an {abstract} flag before or after the class name
A concrete class can have instances (objects) created of the Class, but abstract classes cannot have direct instances
If a class has an abstract operation, then the class must also be abstract.
They must be able to have instances, and all their operations must have a method supplied.
What do we see in this figure?
A Compound Structure has many Structures as parts, which can be either Simple or Compound.
If we make the Structure represent a Mathematical Expressions, we can depict how expressions are built from subexpressions.
This pattern could also represent clauses in English Sentences, or Parts in a Mechanical Assembly.
We made the Structure class an abstract class (in italics) because all structures must be either a Simple Structure or Compound Structure.
No structure can exist that is not resolved to be one of the subclasses.
In such circumstances, the Generalization/Specialization is considered “complete” or “covering.” It is common in such circumstances to make the superclass abstract.
If somehow the political powers force you to allow Tiger licenses, you can ...?
You will probably need a separate method on the Tiger to enforce whatever safety rules a Tiger license requires.
However, other than the new method on Tiger, you would probably not have to change Cat, Dog, or any other class.
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding

- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding