Design patterns·Objects, messages and the principles
the caller pulled three fields out, decided something, and wrote one back — a decision the object should have made itself.
Tell, don't ask
Also calledtell don't ask, TDA
The heuristic that you should send an object a message describing what you want done, rather than interrogating it and acting on its data from outside. It is the practical form of encapsulation: behaviour lives with the data it needs. The counterweight is that not everything is an object with behaviour — a value being reported to a user or serialised has to be asked for, and forcing it through a command is worse than the smell it avoids.