DEV Community

Ratik Mahajan
Ratik Mahajan

Posted on

1

Improve your understanding of SOLID principles in OOPS.

What Does Solid principles mean ?

  • S-> Single responsibility principle : it states that a class or an object in the OOPS programming realm should carry only one responsibility. if there are actions that are taken by student
  • pay for the fees
  • enrolment to new course
  • subjects studying

Assume we can create a class with all the responsibility encapsulated in student class, but that would make our code complex and difficult to maintain.

we have to separate the concerns and make sure that each class is only responsible for one task . this way each class will perform task.

Single responsibility principle

O-> Open and closed principle :
This principle states that we should not change existing functionality or program in the class. we can extend our functionality of the class, but we shouldn't be able to modify it.

this looks really easy while we write it in theory, but we have to think of creating interface and make sure that we even if new classes are added, they implement from the interface and are able to execute the existing core logic.

open/ closed principle

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay