The SOLID Principles

The SOLID principles are an acronym for 5 principles of Object Oriented Design. The original proposition was that, if all 5 principles were followed correctly, any system designed using them would stand a much higher chance of being more maintainable over time.

SOLID principles are a driving force behind the detection of Code Smells and the Refactoring techniques used to remove them. In the next few articles, I’ll be looking at the 5 principles and trying to understand the purpose behind each…

First, an overview of the SOLID principles:

  1. Single Responsibility Principle – An object should have only a single responsibility (Do one thing and do it well)
  2. Open/Closed Principle – An object should be open for extension but closed for modification
  3. Liskov Substitution Principle – Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program
  4. Interface Segregation Principle – Many specific interfaces are better than one general interface
  5. Dependency Inversion Principle – Depend upon abstractions, not on concrete implementations

 

Just looking at these brief descriptions, I can see a lot of similarities with the key focuses of many agile philosophies…

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s