Coder Social home page Coder Social logo

rahulabrol / solid-principles-java-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from happysingh23828/solid-principles-java-example

0.0 1.0 0.0 22 KB

This repository contains the real simple examples of how should we use and accept the SOLID principle in our daily coding

Java 100.00%

solid-principles-java-example's Introduction

SOLID-Design-Pattern-Java-Example

This repository contains the real simple examples of how should we use and accept the SOLID principle in our daily coding

What is SOLID principle?

SOLID Principles is a coding standard that all developers should have a clear concept for developing software in a proper way to avoid a bad design. SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible and maintainable.It was promoted by Robert C Martin and is used across the object-oriented design spectrum

Why we need SOLID principle?

When the developer builds a software following the bad design, the code can become inflexible and more brittle, small changes in the software can result in bugs. For these reasons, we should follow SOLID Principles. It takes some time to understand, but if you write code following the principles it will improve code quality and will help to understand the most well-designed software.

5 principles

1.Single responsibility principle

A class should only have a single responsibility, that is, only changes to one part of the software's specification should be able to affect the specification of the class.

2.Open–closed principle

"Software entities ... should be open for extension, but closed for modification."

3.Liskov substitution principle

"Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program." See also design by contract.

4.Interface segregation principle

"Many client-specific interfaces are better than one general-purpose interface."

5.Dependency inversion principle

One should "depend upon abstractions,concretions."

What this Repository contains?

So in this repository we have five packages of each principle. Each principle has some scenario to understand it and in each principle's packages we have two package Good and Bad.

Contributing

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

Contact - Let's become friend

Referenced

solid-principles-java-example's People

Contributors

happysingh23828 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.