Q&A
Ask and answer questions to make information more available to wider audiences.
Patrick Silvers @silverspatrick   29, Mar 2023 12:00 AM
Dependency Injection
What is DI (Dependency Injection) and how an object or function can get a hold of its dependencies?
answers 2
 
Answer 1
Natalie Jarrett @jarrettnatalie   29, Mar 2023 05:55 PM
These are the ways that object uses to hold of its dependencies:

* Typically using the new operator, dependency can be created
* By referring to a global variable, dependency can be looked up
* Dependency can be passed into where it is required
 
Answer 2
Ryan Burden @ryanburden70   29, Mar 2023 05:51 PM
DI or Dependency Injection is a software design pattern that deals with how code gets hold of its dependencies. In order to retrieve elements of the application which is required to be configured when the module gets loaded, the operation “config” uses dependency injection.