NEWS

Monday, May 10, 2010

Design Patterns vs Design Principles (SOLID)

I was reading the other day a discussion on Design Patterns versus Design Principles called SOLID.

For those who are not aware of this, SOLID is an acronym for the first 5 principles of object-oriented design:


SRP The Single Responsibility Principle: -- a class should have one, and only one, reason to change.
OCP The Open Closed Principle: -- you should be able to extend a class's behavior, without modifying it.
LSP The Liskov Substitution Principle: -- derived classes must be substitutable for their base classes.
ISP The Interface Segregation Principle: -- make fine grained interfaces that are client specific.
DIP The Dependency Inversion Principle -- depend on abstractions not on concrete implementations.
You'll find a fair amount of information on the web on these principles.

It seems to me that you need a good grasp of the SOLID principles before you're ready to tackle Design Patterns (in more of an Architect role).

http://www.davesquared.net/2009/01/introduction-to-solid-principles-of-oo.html

No comments:

Post a Comment