UML Structural Diagram Types
What the exam tests
Structural diagrams in UML 2.5 are seven: Class, Object, Package, Component, Composite Structure, Deployment, and Profile. Foundation questions check the classifier each diagram is built from, its notation, and which relationships are legal.
Core rules
- Class diagram: classifiers (Class, Interface, DataType, Enumeration), features (Properties and Operations), and relationships: association, generalization, realization, dependency, aggregation, composition, association class.
- Object diagram: instances written name : Type or : Type, with links instead of associations; a snapshot at one point in time.
- Package diagram: packages with «import» or «access» dependencies, and merge.
- Component diagram: components with provided and required interfaces (ball-and-socket or «interface»), ports, connectors, «manifest».
- Composite structure: internal parts, ports and connectors; a part is typed by a classifier.
- Deployment: nodes drawn as 3-D boxes, artifacts, «deploy» dependencies, communication paths.
- Profile: «profile», «stereotype», «metaclass»; stereotypes extend metaclasses.
Worked example
An order model has Order with a filled diamond to OrderLine at multiplicity 0..*. Reading: each OrderLine is owned by exactly one Order, and deleting the Order deletes its lines. If the diamond were hollow (shared aggregation), the parts could exist independently and be shared. A separate association Order to Customer with a navigable arrow shows Order can reach Customer; role names and multiplicities refine it.
Traps
- Hollow versus filled diamond: shared aggregation does not imply ownership or deletion.
- Generalization is a solid line with a hollow triangle; realization is dashed with a hollow triangle.
- Drawing a reference as an attribute when it is an association end: both are Properties in the metamodel, but notation differs.
- Deployment nodes are physical targets; components are logical units.
- A profile is a package with «profile» that applies stereotypes; it is not an ordinary model library.