Typos and further change re comments

This commit is contained in:
happyaccidents
2013-11-29 09:46:15 +00:00
committed by Josh Lockhart
parent aaebe65095
commit 4bdbd868c3
2 changed files with 18 additions and 18 deletions

View File

@@ -14,7 +14,7 @@ In terms of Dependency Injection, this means loosening our dependencies by contr
For years, PHP frameworks have been achieving Inversion of Control, however, the question became, which part of control
are you inverting, and where to? For example, MVC frameworks would generally provide a super object or base controller that other
controllers must extend to gain access to it's dependencies. This **is** Inversion of Control, however, instead of loosening
controllers must extend to gain access to its dependencies. This **is** Inversion of Control, however, instead of loosening
dependencies, this method simply moved them.
Dependency Injection allows us to more elegantly solve this problem by only injecting the dependencies we need, when we need them,
@@ -45,7 +45,7 @@ interface AdapterInterface {}
class MysqlAdapter implements AdapterInterface {}
{% endhighlight %}
There are several benefits to the Database class now depending on an interface rather than a concretion.
There are several benefits to the `Database` class now depending on an interface rather than a concretion.
Consider that you are working in a team and the adapter is being worked on by a colleague. In our first example, we would have
to wait for said colleague to finish the adapter before we could properly mock it for our unit tests. Now that the dependency

View File

@@ -6,7 +6,7 @@ isChild: true
The first thing you should understand about Dependency Injection Containers is that they are not the same thing as Dependency
Injection. A container is a convenience utility that helps us implement Dependency Injection, however, they can be and often
are misused to implement an anti pattern, Service Location. Using a container as a Service Locator within your classes arguably
are misused to implement an anti-pattern, Service Location. Injecting a DI container as a Service Locator in to your classes arguably
creates a harder dependency on the container than the dependency you are replacing. It also makes your code much less transparent
and ultimately harder to test.