Depend Upon Abstractions
One nice piece of advice for designing flexible programs is depend upon abstractions, not implementations. This is the idea behind the extract class refactoring. You package up some set of data and functionality, and only allow clients to interact with it through a public API. The class’s internal workings are intentionally hidden. This tends to [...]