What is dependency injection in Laravel ?

Leander
Written by Leander

Posted On: Jan 11, 2019

 

    1 Answer Written

  •  Leander
    Posted by soundariya

    Dependency injection or (D.I) is a technique in software Engineering whereby one object (or static method) supplies the dependencies of another object. A dependency is an object that can be used (a service). Injection is the passing of dependency to a dependent object (a client) that would use it.

    Basically, You can found 3 types of dependency injection:

    • Constructor injection
    • Setter injection
    • Interface injection

Please Login or Register to leave a response.

Related Questions