Why SOLID is important in OOP object oriented programming?

Ms Chi
2 min readSep 10, 2022

I would like to Typescript to demostrate the importance of SOLID here. SOLID is the coding principles of OOP. It is important to know how to implement it and why we need it. Let’s create a service to calculate the total area of one or more shapes.

Single Responsibility Principle : A class should have one and only one reason to change, meaning that a class should have only one job.

Our goal is to calculate the total area of one or more shape. Every class holds single job to satisfy Single Responsibility

--

--

Ms Chi

A typescript JS people who breathes React and Node. Long term learning curve is a must to keep us fresh and competitive. Don’t be overwhelmed by the speed.