Reputation: 12616
Say we have the diagram:
I wonder whether it's known by the diagram who owns the methods.
For instance: Is pickup
a method of Waiter
? Is serve food
then a method of Patron
?
More generally, do the arrows show the owners of the methods?
Upvotes: 1
Views: 620
Reputation:
This is a counterintuitive (ie bad) choice of method names.
Fred is ordering the food, that's right. He's ordering the food by calling takeOrder()
, which belongs to the waiter. Imagine Frank tries to call order food
on anyone other than a waiter
. It wouldn't work, because they're not waiters, and they don't have takeOrder()
.
The methods belong to the objects that are being called.
Upvotes: 4