Giter Club home page Giter Club logo

dependencyinjection's Introduction

DependencyInjection

Dependency Injection means isolating dependencies.

That is, it is an approach that says that you should not create the "new" keyword if you are going to use the object of another class in a class that you will basically create. It emphasizes that the required object must be retrieved as parameter by either the Constructor or the Setter method. Thus, it argues that we have isolated the two classes from each other.

To summarize, the structures that make up the software are inevitably dependent. However, it is important to keep the relationship as loose as possible so that this dependency does not cause a bond or limitation. We call it Loosely Coupled.
Therefore, it is easy to add new features to the application (Open-Closed Principle (OCP) of SOLID), as the structures that make up the software are less tightly connected to each other.

Dependency Injection is often confused with Dependency Inversion. But Dependency Inversion is a principle for problem solving, while Dependency Injection is a Design Pattern that applies this principle.

(D) - Dependency Inversion in SOLID: In layered architectures, the top-level modules must not be directly dependent on the bottom-level modules.

β€œLet the car class change as much as it wants, but the Vasita class doesn't need to know about it. It doesn't need that I won't have to deal with the Vasita class, if we will apply the Dependency Injection (DI) design.

dependencyinjection's People

Contributors

ercanerdogan avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.