Skip to content

This repository contains examples of the five SOLID design principles of object-oriented programming. The examples are written in Java. Each example has a "good" and "bad" version to demonstrate adherence to and violation of the principle, respectively.

Notifications You must be signed in to change notification settings

prashantt17/OOPs-SOLID-Design-Principle

Repository files navigation

solid-Design principles-example

This repository contains examples of the five SOLID design principles of object-oriented programming. The examples are written in Java. Each example has a "good" and "bad" version to demonstrate adherence to and violation of the principle, respectively.

Single responsibility principle - A class should have only one reason to change.

Open/Closed principle - Software entities should be open for extension, but closed for modification.

Liskov Substitution Principle - Child classes should never break the parent class type definitions.

Interface Segregation Principle - No client should be forced to depend on methods it does not use.The number of members in the interface that is visible to the dependent class should be minimised.Large classes implement multiple smaller interfaces that group functions according to their usage

Dependency inversion principle - High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend upon details.

About

This repository contains examples of the five SOLID design principles of object-oriented programming. The examples are written in Java. Each example has a "good" and "bad" version to demonstrate adherence to and violation of the principle, respectively.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages