Software Design: SOLID Principals

Sagiruddin Mondal
1 min readNov 7, 2019

--

This article is all about the five important principals in software design combinedly known as the SOLID principal.

S- Single Responsibility Principal

O- Open Close Principal

L- Liskov Substitution Principal

I- Interface Segregation Principal

D- Dependency Inversion Principal

Single Responsibility Principle:

  • A class will have only one reason to change,
  • Separation of concern.

To Explain, each class will have a very specific job to do. For example, if there is a class related to College and then there are student activities to handle, it is better to have two classes. One for college and the other for students. So, when we need to update any operation in the student class, we need not change anything in the college class.

Open Close Principal:

  • Open for extension closed for modification,

For example, the software design would be in a format, that if there is any upgrade needed for an existing feature,

Liskov Substitute Principal:

  • We should be able to replace a base type for a subtype.
  • To, Elaborate, we should be able to override a parent class method without breaking any functionality.

Interface Segregation Principle:

  • Do not put all the requirements in a single interface. When you think this group of requirements are not common to other ones from a general perspective. DO not include them in a single interface.
  • You ain’t going to need it: So when you do not need it don't keep it in the same interface.

Dependency Inversion Principle:

  • High-level modules should not be directly depending on low-level modules.
  • Use abstractions between them.

--

--

Sagiruddin Mondal
Sagiruddin Mondal

Written by Sagiruddin Mondal

When my science will force you to ride a roller coaster, my art will be there to sit beside you.

No responses yet