{
    "href": "/post/2006/06/27/dependency-injection-in-solar/",
    "relId": "2006/06/27/dependency-injection-in-solar",
    "title": "Dependency Injection in Solar",
    "author": "pmjones",
    "markup": "html",
    "tags": [
        {
            "href": "/tag/php/",
            "relId": "php",
            "title": "PHP",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        },
        {
            "href": "/tag/solar/",
            "relId": "solar",
            "title": "Solar",
            "author": null,
            "created": null,
            "updated": [],
            "markup": "markdown"
        }
    ],
    "created": "2006-06-27 12:24:00 UTC",
    "updated": [
        "2006-06-27 12:24:00 UTC"
    ],
    "html": "<p>Jeff Moore talks about <a href=\"http://www.procata.com/blog/archives/2006/06/26/dependency-injection-in-php/\">dependency injection in PHP</a> and opines as to how he'd like to see \"the current crop of frameworks\" adopt the technique.  Jeff, your wish is granted!  (At least for Solar.  ;-)</p>\n<p>Because it makes great use of dependecy injection, <a href=\"http://solarphp.com/\">Solar</a> has a standardized form of generating/retrieving dependency objects using its <a href=\"http://solarphp.org/manual:solar:dependency_injection\">Solar::dependency()</a> method.</p>\n<p>The calling code sends the dependency params to the target object at construction time.  The target object then passes those params through Solar::dependency() to retrieve or create the dependency object.</p>\n<p>The params may be an object (the dependency object itself), or a string (treated as a registry key for <a href=\"http://solarphp.com/class/Solar_Registry::get()\">Solar_Registry::get()</a>), or an array (which are treated as params to create a new dependency object internally at the target using <a href=\"http://solarphp.com/class/Solar::factory()\">Solar::factory()</a>).</p>\n<p>UPDATE (2009-03-28): Updating documentation links.</p>\n"
}
