<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Europe VAN &#8211; DDD with Greg Young (9th February)</title>
	<atom:link href="http://lostechies.com/colinjack/2009/02/09/europe-van-ddd-with-greg-young/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/colinjack/2009/02/09/europe-van-ddd-with-greg-young/</link>
	<description>Just another LosTechies site</description>
	<lastBuildDate>Tue, 24 Aug 2010 06:44:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Jonathan</title>
		<link>http://lostechies.com/colinjack/2009/02/09/europe-van-ddd-with-greg-young/#comment-39</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Tue, 17 Mar 2009 18:29:30 +0000</pubDate>
		<guid isPermaLink="false">/blogs/colinjack/archive/2009/02/09/europe-van-ddd-with-greg-young.aspx#comment-39</guid>
		<description>Colin,

At about minute 64 in the video you asked the question of how to apply the specification pattern on a domain object that doesn&#039;t expose its state (no getters/setters).

Greg answered and said that there wasn&#039;t a really good way to do it because of technical limitations with C# and then he proposed marking certain properties as internal (instead of private) and using NDepend or some other mechanism.

What we do instead is to have an interface--typically one with an &quot;internal&quot; accessibility modifier.  Then, we have the domain object implement this interface explicitly rather than implicitly, e.g.:

string IMyInternalInterface.FirstName { get; }

rather than:

public string FirstName { get; }

Then, you simply have your specification use IMyInternalInterface.

Granted, there&#039;s a little bit of casting involved, but covariance in C# 4 should address the casting issues.</description>
		<content:encoded><![CDATA[<p>Colin,</p>
<p>At about minute 64 in the video you asked the question of how to apply the specification pattern on a domain object that doesn&#8217;t expose its state (no getters/setters).</p>
<p>Greg answered and said that there wasn&#8217;t a really good way to do it because of technical limitations with C# and then he proposed marking certain properties as internal (instead of private) and using NDepend or some other mechanism.</p>
<p>What we do instead is to have an interface&#8211;typically one with an &#8220;internal&#8221; accessibility modifier.  Then, we have the domain object implement this interface explicitly rather than implicitly, e.g.:</p>
<p>string IMyInternalInterface.FirstName { get; }</p>
<p>rather than:</p>
<p>public string FirstName { get; }</p>
<p>Then, you simply have your specification use IMyInternalInterface.</p>
<p>Granted, there&#8217;s a little bit of casting involved, but covariance in C# 4 should address the casting issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent</title>
		<link>http://lostechies.com/colinjack/2009/02/09/europe-van-ddd-with-greg-young/#comment-38</link>
		<dc:creator>Brent</dc:creator>
		<pubDate>Mon, 09 Feb 2009 18:32:12 +0000</pubDate>
		<guid isPermaLink="false">/blogs/colinjack/archive/2009/02/09/europe-van-ddd-with-greg-young.aspx#comment-38</guid>
		<description>DDD</description>
		<content:encoded><![CDATA[<p>DDD</p>
]]></content:encoded>
	</item>
</channel>
</rss>
