From f7344a1f886a66992875ce5fc0c87dff474e3949 Mon Sep 17 00:00:00 2001 From: Kier Borromeo Date: Tue, 14 Apr 2015 15:54:42 +0800 Subject: [PATCH] interface to class This seems to be a typo. No? --- 09-templating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/09-templating.md b/09-templating.md index d597228..f023224 100644 --- a/09-templating.md +++ b/09-templating.md @@ -16,7 +16,7 @@ You could just type hint against the concrete class. But the problem with this a In other words, all your code that uses the engine will be coupled to this mustache package. If you want to change the implementation you have a problem. Maybe you want to switch to Twig, maybe you want to write your own class or you want to add functionality to the engine. You can't do that without going back and changing all your code that is tightly coupled. -What we want is loose coupling. We will type hint against an interface that implements an interface. So if you need another implementation, you just implement that interface in your new class and inject the new class instead. +What we want is loose coupling. We will type hint against a class that implements an interface. So if you need another implementation, you just implement that interface in your new class and inject the new class instead. Instead of editing the code of the package we will use the [adapter pattern](http://en.wikipedia.org/wiki/Adapter_pattern). This sounds a lot more complicated than it is, so just follow along.