<?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>Sun, 26 May 2013 03:42:33 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Nicolas B&eacute;rard-Nault's Blog: The unknown value of Value Objects]]></title>
      <guid>http://www.phpdeveloper.org/news/16131</guid>
      <link>http://www.phpdeveloper.org/news/16131</link>
      <description><![CDATA[<p>
<i>Nicolas B&eacute;rard-Nault</i> has put together a new post looking at the role that Value Objects play in application development and, more specifically, how they fit in with domain driven design (DDD). He looks to explain the <a href="http://nicobn.wordpress.com/2011/03/29/the-unknown-value-of-value-objects/">unknown value of Value Objects</a> to developers that might not know how helpful they really can be.
</p>
<blockquote>
One of the main rules of DDD is that value objects are immutable. This is often not as self-evident as it seems, as many programmers are not even aware of the state they leak and create. Sadly, state is often positively correlated with entropy. Hence, taking steps to contain and to limit state is one of the keys to taming complexity in an application.
</blockquote>
<p>
He notes that even outside of DDD Value Objects can be quite useful. He gives an example of a "RationalNumber" class with methods for basic things like addition and subtraction. He shows the more traditional mutable version that most developers would start with and uses it in several examples to show its flaws. He finishes up the post with a look at the "more correct" immutable version of the class and a sample call that would result in the correct output of a simple matematical operation.
</p>]]></description>
      <pubDate>Thu, 31 Mar 2011 12:12:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Bradley Holt's Blog: Immutable Value Objects in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15217</guid>
      <link>http://www.phpdeveloper.org/news/15217</link>
      <description><![CDATA[<p>
<i>Bradley Holt</i> has a new post to his blog about a subject he's recently been learning about, Domain-Driven Design, and how <a href="http://bradley-holt.com/2010/09/immutable-value-objects-in-php/">immutable value objects could be useful in PHP</a>.
</p>
<blockquote>
Yesterday I <a href="http://twitter.com/BradleyHolt/status/25911903352">tweeted</a>: Modern object-oriented programming languages need support for immutable Value Objects. #DDD The "DDD" in that tweet stands for <a href="http://en.wikipedia.org/wiki/Domain-driven_design">Domain-Driven Design</a>. There were several interesting responses to this tweet.
</blockquote>
<p>
Responses to his tweet included comments from <a href="http://paste2.org/p/1009796">Matthew Weier O'Phinney</a>, <a href="http://gist.github.com/603496">Ralph Schindler</a>, <a href="http://twitter.com/nicolasbn/status/25942269645">Nicolas Berard-Nault</a> and <a href="http://twitter.com/giorgiosironi/status/25914287997">Giorgio Sironi</a>. He notes that, while all of the suggestions are good, they're only half of the issue. They make it immutable when defined but not during execution. Currently PHP lacks this functionality, but something like this could be worked in with the concept of a "final" class.
</p>]]></description>
      <pubDate>Fri, 01 Oct 2010 11:15:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPFreaks.com: Design Patterns - Strategy/Bridge, Value Object, Singleton (Registry)]]></title>
      <guid>http://www.phpdeveloper.org/news/11183</guid>
      <link>http://www.phpdeveloper.org/news/11183</link>
      <description><![CDATA[<p>
Following up on their <a href="http://www.phpdeveloper.org/news/11174">introduction to design patterns</a>, the PHP Freaks have posted tutorials covering three of the more popular patterns - strategy/bridge, value object and singleton.
</p>
<ul>
<li><a href="http://www.phpfreaks.com/tutorial/design-patterns---strategy-and-bridge">Strategy and Bridge</a> - The Strategy and Bridge patterns provide solutions to apply polymorphism in more flexible way than you can accomplish with only inheritance.
<li><a href="http://www.phpfreaks.com/tutorial/design-patterns---value-object">Value Object</a> - The Value Object pattern has, just like the Singleton, to do with referencing and instances. In a way, the Value Object is the opposite of the Singleton: it's goal is to ensure NOT to use the same instance, under certain conditions.
<li><a href="http://www.phpfreaks.com/tutorial/design-patterns---singleton-and-singleton-registry">Singleton and Singleton Registry</a> - The Singleton pattern ensures that you are always dealing with the same, single instance, wherever in your application. The Registry pattern usually utilizes the Singleton pattern (hence "Singleton Registry") to make the same 'globalness' apply to objects who's classes weren't necessarily designed to
</ul>
<p>
Keep checking back to <a href="http://www.phpfreaks.com/tutorials">their tutorials section</a> for more design pattern tutorials.
</p>]]></description>
      <pubDate>Fri, 10 Oct 2008 09:33:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Knut Urdalen's Blog: ORM the manual way]]></title>
      <guid>http://www.phpdeveloper.org/news/8547</guid>
      <link>http://www.phpdeveloper.org/news/8547</link>
      <description><![CDATA[<p>
<i>Knut Urdalen</i>, on seeing some of <a href="http://kore-nordmann.de/blog/why_active_record_sucks.html">the recent discussion</a> on why the ActiveRecord pattern sucks and <a href="http://www.urdalen.com/blog/?p=210">talks about</a> why, when presented with a the need for a database layer, he usually goes back to his own familiar Singleton-based style.
</p>
<blockquote>
I normally use a simple solution using the <a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singleton</a> pattern for managing the database connection, the <a href="http://www.martinfowler.com/eaaCatalog/valueObject.html">Value Object</a> pattern for all business objects and the <a href="http://www.martinfowler.com/eaaCatalog/dataMapper.html">Data Mapper</a> pattern to manage the mapping between business objects and the database schema. It's as simple as that '" handcrafted and no magic going on.
</blockquote>
<p>
The <a href="http://www.urdalen.com/blog/?p=210">post also includes</a> his code for an example of a database connection - the creation of the Singleton interface class, making the Value Objects and customizing one for the type of "Product".
</p>]]></description>
      <pubDate>Wed, 29 Aug 2007 07:57:00 -0500</pubDate>
    </item>
  </channel>
</rss>
