Home > Software Development > Writing SOLID code – OO Design Principles

Writing SOLID code – OO Design Principles


Setting the Stage

Going to geek out a bit on this post. I had a friend come up to me a while back and point me towards several screencasts on writing good Object-Oriented (OO) code in .NET using SOLID design principles.

Now, I had read the wonderful book on OO design patterns for Java developers Head First Design Patterns, so it turns out I was familiar with all of the core SOLID design principles from reading this book. But I just hadn’t head the acronym SOLID before. So what are SOLID design principles?

SOLID Design Principles

So “SOLID” is actually an acronym for 5 key OO design principles, which are as follows:

  1. Single Responsibility Principle (SRP)
  2. Open-Closed Principle (OCP)
  3. Liskov Substitution Principle (LSP)
  4. Interface Segregation Principle (ISP)
  5. Dependency Inversion Principle (DIP)

Perhaps frustratingly, I’m not actually going to discuss the meaning of these OO design principles here. Rather, the list above contains hyperlinks to screencasts that illustrate each of the SOLID design principles. So if designing good OO-based software is of interest to you, and you haven’t encountered these principles before, I recommend you give these screencasts a boo.

What is the origin of the SOLID acronym?

Well, good OO design principles probably date back at the very least to the Smalltalk community of the early 1980s (I think). But as this Wikipedia article states, the SOLID acronym was introduced by Robert C. Martin in the early 2000s. Here’s a link to a paper Martin wrote in 2000 explaining SOLID Principles of OO Design.

So that’s about all I have to say on the matter for now. 🙂

glenn

Advertisements
  1. No comments yet.
  1. January 18, 2011 at 7:20 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: