General design principles
- Identify the aspects of your application that vary and separate them from what stays the same.
- Program to an interface, not an implementation.
- Depend upon abstractions. Do not depend upon concrete classes.
- Favor composition over inheritance.
- Strive for loosely coupled designs between objects that interact.
- Classes should be open for extension, but closed for modification.
- Principle of the Least Knowledge: talk only to your immediate friends. (the same principle: Law of Demeter)
- The Hollywood Principle: don't call us, we'll call you.
- A class should have only one reason to change