{
    "href": "/post/2013/11/21/servicelocator-is-like-the-dark-side-quicker-easier-more-seductive/",
    "relId": "2013/11/21/servicelocator-is-like-the-dark-side-quicker-easier-more-seductive",
    "title": "ServiceLocator is like the Dark Side: Quicker, Easier, More Seductive",
    "author": "pmjones",
    "markup": "html",
    "tags": [
        {
            "href": "/tag/php/",
            "relId": "php",
            "title": "PHP",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/programming/",
            "relId": "programming",
            "title": "Programming",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        }
    ],
    "created": "2013-11-21 23:51:10 UTC",
    "updated": [
        "2013-11-21 23:51:10 UTC"
    ],
    "html": "<p>When it comes to <a href=\"http://martinfowler.com/articles/injection.html\">Inversion of Control</a>, a <a href=\"http://martinfowler.com/articles/injection.html#UsingAServiceLocator\">Service Locator</a> is like the Dark Side of the Force: quicker, easier, more seductive. But it gets you into trouble later on. Go with <a href=\"http://martinfowler.com/articles/injection.html#FormsOfDependencyInjection\">Dependency Injection</a> whenever you can instead.</p>\n<p>A lot of things calling themselves Dependency Injection containers are actually Service Locators. If you inject the container into an object, or if you call it statically from inside an object, and the object then pulls things out of the container, the container is acting as a Service Locator.</p>\n"
}
