class Mammal { ... virtual Status Sleep(bool hibernate) = 0; }; class Human : public Mammal { ... virtual Status Sleep(bool hibernate) { age += hibernate ? kSevenMonths : kSevenHours; return OK; } };
class Human { ... void Sleep() { age += kSevenHours; } };
Isn't this exactly opposite to "Inversion of Control" design principle?
The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments.
Isn't this exactly opposite to "Inversion of Control" design principle?
ReplyDelete