Class diagram
The notation of the UML class diagram: the three-compartment box, visibilities, static and abstract members, multiplicities and the five links (generalisation, realisation, aggregation, composition, dependency).
- 26 cards
- 4 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- Understand
A few cards from the deck
Class diagram: what is it?
Show the answer
A UML drawing that shows the parts of an object-oriented program, what they hold and the fixed links between them.
It describes structure, not behaviour over time: for the order of calls, you draw a sequence diagram.
What does this line in the operations compartment say?
```text
# valider(code : String) : boolean`- A protected method, visible in the class and its subclasses
- A private method, visible in the class alone
- A static method, shared by all instances
- An abstract method, to be written in every subclass
Show the answer
A protected method, visible in the class and its subclasses
#is protected visibility. Private is-, public+, package~; static is marked by underlining, abstract by italics.In UML, the type is written … the name, separated by a colon:
- balance : double.Show the answer
In UML, the type is written after the name, separated by a colon:
- balance : double.That is the reverse of Java, where the type comes first (
double balance). The same rule holds for parameters and return types.Three-compartment box: what is it?
Show the answer
The UML rectangle that stands for a class: the name on top, the attributes in the middle, the operations at the bottom.
The two lower compartments can be hidden when only the links between classes matter.
Why does a class diagram say nothing about the order in which methods call each other?
- UML forbids writing methods there, only attributes appear
- It shows the program's structure, not how it unfolds over time
- Operations are never written there with their parameters or types
- The order of calls depends on the language chosen for the code
Show the answer
It shows the program's structure, not how it unfolds over time
Each UML diagram answers one question: what is the program made of (classes), who talks to whom and in what order (sequence). The methods appear, with their parameters and types, but without their chaining.