Grokking the Object Oriented Design Interview
Vote

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 stand in for the other. Getting it wrong is the fastest way to lose credit in this round. It 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%


Vote for new content