Member-only story

SOLID Software Design Principles-Write better code(OOP)

The Test Lead
4 min readNov 30, 2021

--

Photo by Pankaj Patel on Unsplash

SOLID is an acronym for principles in coding to write clean and reusable code. SOLID stands for the following principles:

S-Single Responsibility

O-Open/Closed

L-Liskov Substitution

I-Interface Segregation

D-Dependency Inversion

This article will give you a high-level introduction to each principle as well as tell you why each is important.

Photo by Photos by Lanty on Unsplash

Single Responsibility Principle

The Single Responsibility Principle is based on the concept that a class should only have one reason to change. A class should only have one responsibility and you should be able to define what the class does in 1 sentence.

The purpose for this is having a class that only has one purpose allows for easier reusability. If a class is doing several different things, it makes it harder to use that class efficiently. You may extend that class and the child class may not use its functionality which is not proper practice. We will talk about proper inheritance later in this article.

--

--

The Test Lead
The Test Lead

Written by The Test Lead

Lead SDET at fintech company in NYC. Visit personal page http://thetestinglead.com// Twitter @juss_bailey Youtube @The Test Lead

No responses yet