https://github.com/pg07codes/solid-principles
OOPS most famous design principles explained with java code examples
https://github.com/pg07codes/solid-principles
Last synced: 11 months ago
JSON representation
OOPS most famous design principles explained with java code examples
- Host: GitHub
- URL: https://github.com/pg07codes/solid-principles
- Owner: pg07codes
- Created: 2022-03-08T18:34:12.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-27T11:56:36.000Z (almost 4 years ago)
- Last Synced: 2025-01-28T02:33:10.255Z (about 1 year ago)
- Language: Java
- Size: 21.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# S.O.L.I.D principles
> explained using multiple examples in JAVA
* **Single responsibility principle** - A class should have only one reason to change.
* **Open/Closed principle** entities should be open for extension, but closed for modification.
* **Liskov Substitution Principle** - Child classes should never break the parent class type definitions.
* **[This baeldung's article](https://www.baeldung.com/java-liskov-substitution-principle)** really connects the **open/closed principle** and **liskovs principle** together and explains it beautifully. please do refer to it.
* **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.
**Please note:** All the principles have two sets of examples
- theoretical - this is a relatively simpler example(in a single file) to drive the idea behind the principle across
- practical - this is a little complex example, more in sync with the real word.
- both theoretical, practical have bad,good to show the wrong from right behaviour.
## Credits
i love the amazing knowledge spread across the internet. To study, understand and create this, i refered to [doku insight's](https://medium.com/doku-insight/solid-principles-with-example-7bd77972787b) and [nerd-for-tech](https://medium.com/nerd-for-tech/solid-principles-in-java-5cf926e44247) medium's article and also from this [github repo](https://github.com/muratkarakas/solid-principles). Thanks to you guys as well.
## Further Reading
- i really like this article by stack abuse on [OOPS design principles](https://stackabuse.com/object-oriented-design-principles-in-java/)