<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Santoro &#187; value objects</title>
	<atom:link href="http://www.davidsantoro.net/?feed=rss2&#038;tag=value-objects" rel="self" type="application/rss+xml" />
	<link>http://www.davidsantoro.net</link>
	<description>Just another blog on software development experiences...</description>
	<lastBuildDate>Mon, 08 Mar 2010 07:18:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Value Objects rocks!</title>
		<link>http://www.davidsantoro.net/?p=44</link>
		<comments>http://www.davidsantoro.net/?p=44#comments</comments>
		<pubDate>Sat, 06 Mar 2010 21:41:38 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ddd]]></category>
		<category><![CDATA[object oriented programming]]></category>
		<category><![CDATA[ood]]></category>
		<category><![CDATA[value objects]]></category>

		<guid isPermaLink="false">http://www.davidsantoro.net/?p=44</guid>
		<description><![CDATA[For our book club in Ewloe we decided for a change to watch an infoq video. The team was showing an interest for DDD and few recent refactoring were towards encapsulation of logic in a few core Value Objects. Mike Wagg and Mark Needham suggested one of the talk they attended at QCon London 2009 [...]]]></description>
			<content:encoded><![CDATA[<p>For our book club in Ewloe we decided for a change to watch an infoq video.<br />
The team was showing an interest for DDD and few recent refactoring were towards encapsulation of logic in a few core Value Objects. Mike Wagg and Mark Needham suggested one of the talk they attended at QCon London 2009 <a href="http://www.infoq.com/presentations/Value-Objects-Dan-Bergh-Johnsson">Dan Bergh Johnsson value objects talk</a>.</p>
<p>Discussing the talk one question came out, &#8220;When do we introduce value objects, right from the beginning or when certain conditions arise?&#8221;</p>
<p>The agreed answer was to introduce them later by refactoring although I now feel that we should introduce them earlier for the following reasons:</p>
<ul>
<li>They become useful very quickly</li>
<li>They help express intent and help understand the domain</li>
<li>Having few examples of Value Objects in the code base helps new developers pick up good habits because they tend to copy from existing code at the beginning</li>
</ul>
<p>An interesting side effect of value objects&#8230; they make programmers happier! I saw smiles appear on the face of one pair of developers after they figure how value objects helped them avoid some dodgy code duplicated code in the view.</p>
<p>Another side effect of value objects is that they help you avoid null references by facilitating the introduction of Null Objects. </p>
<p>The only things that stops me to use value objects more is the friction that some tools like ORM cause. For example in order to have value objects field properly mapped using Hibernate it is necessary to implement a Custom User Type which can be an onerous an error prone operation.<br />
There is also a lack of refactoring tools that helps you encapsulating one or more fields in a composite object.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.davidsantoro.net%2F%3Fp%3D44&amp;linkname=Value%20Objects%20rocks%21"><img src="http://www.davidsantoro.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.davidsantoro.net/?feed=rss2&amp;p=44</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
