3 ms·
You are glossing over a lot of design decisions by excluding method arguments. Whether or not that is a proper solution depends upon the requirements. A more
by sbov 10y ago
You are glossing over a lot of design decisions by excluding method arguments.
Whether or not that is a proper solution depends upon the requirements.
A more useful example for beginners would be showing when you want an "eat" on a person class vs an "eaten by" on a food class vs when you need to pull out something more heavy handed.
Eg if your only axis of change is the foods you eat, and behavior is based primarily upon food, person as a dumb bag of data is likely the correct answer. Your behavior should probably be in a food class.