According to Khorikov, a well-designed API (application programming interface), is one in which Observabled Behaviours are entirely in the Public API, and implementation details are part of the Private API.
The simplest way to tell if a class leaks a implementation detail into observable behaviour is if number of operations client needs to perform to achieve a goal is > 1.
Good Encapsulation protects against Invariant violations, especially as the complexity of the code base increases.
You cannot trust yourself to do the right thing all the time - so, eliminate the very possibility of doing the wrong thing
Schell (2015) (pg. 100)
Related to Martin Fowler's Tell Don't Ask pattern.
Jesse Schell. The Art of Game Design: A Book of Lenses. CRC Press, Boca Raton, second edition edition, 2015. ISBN 978-1-4665-9864-5. ↩