mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-30 08:39:57 +02:00
Revisions
This commit is contained in:
committed by
Josh Lockhart
parent
5e0f12004c
commit
aaebe65095
@@ -4,5 +4,10 @@ title: Dependency Injection
|
||||
|
||||
# Dependency Injection {#dependency_injection_title}
|
||||
|
||||
Dependency Injection is a basic concept that solves a complex problem. As a software design pattern it is being adopted in
|
||||
some way or another by all major PHP projects.
|
||||
From [Wikipedia](http://en.wikipedia.org/wiki/Dependency_injection):
|
||||
|
||||
> Dependency injection is a software design pattern that allows the removal of hard-coded dependencies and makes it
|
||||
> possible to change them, whether at run-time or compile-time.
|
||||
|
||||
This quote makes the concept sound much more complicated than it actually is. Dependency Injection is providing a component
|
||||
with it's dependencies either through constructor injection, method calls or the setting of properties. It is that simple.
|
||||
|
Reference in New Issue
Block a user