# SOLID: Software Design Principles

**S.O.L.I.D** design principle comes from Object oriented programming guidelines. It is designed to develop software that can be easily maintained and extended; prevents code smells; easy to refractor; promotes agility and finally incorporates rapid + frequent changes quickly without bugs.

<figure>
	<blockquote>
		<p>
Generally, technical debt is the result of prioritizing speedy delivery over perfect code. To keep it under control - use SOLID principles, during development.</p>
	</blockquote>
</figure>

<a href="https://twitter.com/unclebobmartin" target="_blank">Robert Martin</a>, is credited with writing the SOLID principles and stated 4 major software issues if S.O.L.I.D is not followed diligently. They are :

- **<ins>Rigidity</ins>**:

  - Implementing even a small change is difficult since it's likely to translate into a cascade of changes.

- **<ins>Fragility</ins>**:

  - Any change tends to break the software in many places, even in areas not conceptually related to the change.

- **<ins>Immobility</ins>**:

  - We're unable to reuse modules from other projects or within the same project because those modules have lots of dependencies.

- **<ins>Viscosity</ins>**:
  - Difficult to implement new features the right way.

### SOLID is a guideline and not a rule. It is important to understand the crux of it and incorporate it with a crisp judgement. There can be a case when only few principles out of all is required.

## <ins>S.O.L.I.D stands for</ins>:

- **Single Responsibility Principle (SRP)**;
- **Open Closed Principle (OCP)**;
- **Liskov Substitution Principle (LSP)**;
- **Interface Segregation Principle (ISP)**;
- **Dependency Inversion Principle (DIP)**;


## <ins>**Single Responsibility Principle (SRP)**</ins>

Every function, class or module should have one, and only one reason to change, implies should have only one job and encapsulate within the class (stronger cohesion within the class).

`It supports "Separation of concerns" — do one thing, and do it well!"`

To continue reading, head over to [Box Piper](https://www.boxpiper.com/posts/solid-software-design-principles/) source.

To read more such interesting topics, follow and read <a href="https://boxpiper.com/">BoxPiper blog</a>.

Support my work and [buy me a Coffee](https://ko-fi.com/E1E72C2MM). It'll mean the world to me. 😇

<a href="https://ko-fi.com/E1E72C2MM"><img src="https://cdn.ko-fi.com/cdn/kofi1.png?v=2"/></a>

