Grokking the Object Oriented Design Interview
0% completed
Choosing the Relationship Between Two Classes
You have twelve classes. Now you have to say how each pair connects. There are only four answers worth knowing.
A relationship is a claim about lifetime and about substitution. Lifetime asks whether one object dies when the other does. Substitution asks whether one object can be used in place of the other. A wrong relationship is the fastest way to lose credit in this round. The mistake is visible in the diagram without reading a line of code.
This lesson gives you a decision you can make in about ten seconds per pair.
The four relationships
**Association
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%