<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 23:18:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Giorgio Sironi's Blog: When to inject: the distinction between newables and injectables]]></title>
      <guid>http://www.phpdeveloper.org/news/12974</guid>
      <link>http://www.phpdeveloper.org/news/12974</link>
      <description><![CDATA[<p>
Following up on a <a href="http://www.phpdeveloper.org/news/12960">previous post</a> about dependency injection, <i>Giorgio Sironi</i> has posted <a href="http://giorgiosironi.blogspot.com/2009/07/when-to-inject-distinction-between.html">this new look</a> at when to use dependency injection and when its still better to handle objects individually.
</p>
<blockquote>
In the last post, I introduced Dependency Injection and show useful cases where it allows classes decouplng. I also wrote about the problem of how to inject a service in a class that has to be instantiated not application wide but in the business logic.
</blockquote>
<p>
He creates an example that shows a not-so-good place to use dependency injection and offers a solution - a factory that creates the objects as they're needed instead of having them floating around when they're not needed. He also talks about the difference between two types of business objects to consider in dependency injection: entities and services (hint: one depends on the other).
</p>]]></description>
      <pubDate>Fri, 31 Jul 2009 10:58:39 -0500</pubDate>
    </item>
  </channel>
</rss>
