Wednesday, 16 March 2011

Principles of object-oriented design

SOLID - five simple principles of object-oriented design
introduced by Robert C. Martin

- Single responsibility principle (S) - that an object should have only a single responsibility
- Open/closed principle (O) - “software entities … should be open for extension, but closed for modification
- Liskov substitution principle (L) - objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program
- Interface separation (I) - many client specific interfaces are better than one general purpose interface.
Dependency inversion principle (D) - Depend upon Abstractions. Do not depend upon concretions.