<?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: Transitory Domain Objects</title>
	<atom:link href="http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/</link>
	<description>Advanced web application development tactics - from scalability to UI design</description>
	<lastBuildDate>Sun, 22 Aug 2010 14:58:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: perfect optimizer best</title>
		<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/comment-page-1/#comment-227</link>
		<dc:creator>perfect optimizer best</dc:creator>
		<pubDate>Sun, 22 Aug 2010 14:58:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.calyptus.eu/?p=125#comment-227</guid>
		<description>I get pleasure from your personal be of assistance, it&#039;s used by my family,pick a&#039;s and b&#039;s!</description>
		<content:encoded><![CDATA[<p>I get pleasure from your personal be of assistance, it&#8217;s used by my family,pick a&#8217;s and b&#8217;s!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Markbåge</title>
		<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/comment-page-1/#comment-22</link>
		<dc:creator>Sebastian Markbåge</dc:creator>
		<pubDate>Sun, 31 May 2009 14:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.calyptus.eu/?p=125#comment-22</guid>
		<description>The problem with both those approaches is that I can&#039;t easily do the filtering of Red hue in one place and marking them with meta data in another place. By introducing a transient workflow concept to the domain, I can move the concept around within my domain logic as well as in my application.

myController.Photos = photoSet.UsingOnly(Color.Red);

public IEnumerable&lt;Photo&gt; List()
{
  return myController.Photos;
}

public void Apply(string text)
{
  return myController.Photos.MarkWithMetadata(text);
}

Granted, this is a too simplistic example as always with DDD. But you can see that as this gets more complex I&#039;d have to pass around references to repository and services and/or specifications (Color.Red).

In this case &quot;PhotoSet&quot; is a domain specific term which is why I went with that. Even though Set is also a technical term I favored the ubiquitous language. I&#039;ve also had the terms Collection and List in my domains. Imagine a fashion designer&#039;s &quot;collection&quot; or a customer &quot;list&quot; with own domain properties.

It&#039;s not my place to dictate the UL of the domain.</description>
		<content:encoded><![CDATA[<p>The problem with both those approaches is that I can&#8217;t easily do the filtering of Red hue in one place and marking them with meta data in another place. By introducing a transient workflow concept to the domain, I can move the concept around within my domain logic as well as in my application.</p>
<p>myController.Photos = photoSet.UsingOnly(Color.Red);</p>
<p>public IEnumerable
<photo> List()<br />
{<br />
  return myController.Photos;<br />
}</p>
<p>public void Apply(string text)<br />
{<br />
  return myController.Photos.MarkWithMetadata(text);<br />
}</p>
<p>Granted, this is a too simplistic example as always with DDD. But you can see that as this gets more complex I&#8217;d have to pass around references to repository and services and/or specifications (Color.Red).</p>
<p>In this case &#8220;PhotoSet&#8221; is a domain specific term which is why I went with that. Even though Set is also a technical term I favored the ubiquitous language. I&#8217;ve also had the terms Collection and List in my domains. Imagine a fashion designer&#8217;s &#8220;collection&#8221; or a customer &#8220;list&#8221; with own domain properties.</p>
<p>It&#8217;s not my place to dictate the UL of the domain.</photo>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Alsing</title>
		<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/comment-page-1/#comment-21</link>
		<dc:creator>Roger Alsing</dc:creator>
		<pubDate>Sun, 31 May 2009 08:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.calyptus.eu/?p=125#comment-21</guid>
		<description>IMO, what you are doing is Domain Services with an Internal DSL API.

I do like the look of that API.
But it would be possible to make it as a pure old domain service too:

var photoService = new PhotoService();
photoService.MarkWithMetadata( photoRepository , colorDetectorService, metaDataService, Color.Red, &quot;RED&quot;);

Or if you use a container of some sort to configure your service instances.

var photoService = foo.Get();
photoService.MarkWithMetadata( Color.Red, &quot;RED&quot;);

But I do like the fluent interface / internal DSL approach you have.
The thing that bothers me about it though is that &quot;PhotoSet&quot; is probably ambigious semantics with what you get from a photo repository.

You do get sets of photos from photo repositories.
(most likely some IList (ignoring the fact that ilist is not a true set interface))

Thus it would blur the meaning of a &quot;photo set&quot;
Unless you explicitly starts talking about Photo Sets and Collections of Photos.</description>
		<content:encoded><![CDATA[<p>IMO, what you are doing is Domain Services with an Internal DSL API.</p>
<p>I do like the look of that API.<br />
But it would be possible to make it as a pure old domain service too:</p>
<p>var photoService = new PhotoService();<br />
photoService.MarkWithMetadata( photoRepository , colorDetectorService, metaDataService, Color.Red, &#8220;RED&#8221;);</p>
<p>Or if you use a container of some sort to configure your service instances.</p>
<p>var photoService = foo.Get();<br />
photoService.MarkWithMetadata( Color.Red, &#8220;RED&#8221;);</p>
<p>But I do like the fluent interface / internal DSL approach you have.<br />
The thing that bothers me about it though is that &#8220;PhotoSet&#8221; is probably ambigious semantics with what you get from a photo repository.</p>
<p>You do get sets of photos from photo repositories.<br />
(most likely some IList (ignoring the fact that ilist is not a true set interface))</p>
<p>Thus it would blur the meaning of a &#8220;photo set&#8221;<br />
Unless you explicitly starts talking about Photo Sets and Collections of Photos.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Markbåge</title>
		<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/comment-page-1/#comment-20</link>
		<dc:creator>Sebastian Markbåge</dc:creator>
		<pubDate>Sat, 30 May 2009 22:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.calyptus.eu/?p=125#comment-20</guid>
		<description>&gt;&gt; &gt;&gt;The reference itself is (usually) infrastructure and not really a persistence concern.
&gt;&gt; Entities are not supposed to deal with persistence concerns, they are supposed to deal with _domain_ concerns.
&gt;&gt; The entire point of POCO is not have persistence concerns in the entities.

Yea, what I meant to say was that it isn&#039;t a persistent concern within the domain. Even if that persistence is only in memory. A property of an entity is persistent as opposed to a temporary variable in a method. (Suggestions for better verbiage are welcome.)

Service references are a transient concern during a certain operation only. I.e. infrastructure.</description>
		<content:encoded><![CDATA[<p>>> >>The reference itself is (usually) infrastructure and not really a persistence concern.<br />
>> Entities are not supposed to deal with persistence concerns, they are supposed to deal with _domain_ concerns.<br />
>> The entire point of POCO is not have persistence concerns in the entities.</p>
<p>Yea, what I meant to say was that it isn&#8217;t a persistent concern within the domain. Even if that persistence is only in memory. A property of an entity is persistent as opposed to a temporary variable in a method. (Suggestions for better verbiage are welcome.)</p>
<p>Service references are a transient concern during a certain operation only. I.e. infrastructure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Markbåge</title>
		<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/comment-page-1/#comment-19</link>
		<dc:creator>Sebastian Markbåge</dc:creator>
		<pubDate>Sat, 30 May 2009 22:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.calyptus.eu/?p=125#comment-19</guid>
		<description>&gt;&gt; In the easiest case it can be done by simply require the consumer to pass the reference into a method instead.

Yea, this is typically using double dispatch.

&gt;&gt; That is not completely true, “domain services” are apart of the domain itself, and have a very clear role in the domain.

Services is such an overused term and it&#039;s unclear when to use it. Services in DDD are too undefined and can span various concepts. Thus violating single responsibility.

&quot;Domain services&quot; is close to what I&#039;m doing but I&#039;m using a slightly definition and different constraints to put it more in line with the UL and ensure separation of concerns.

I don&#039;t couple any external operations to my transient domain objects. They are side-effect free, as Haskell people would call it. Therefore I don&#039;t use an interface and I don&#039;t bother with IoC because they contain only side-effect free domain logic.</description>
		<content:encoded><![CDATA[<p>>> In the easiest case it can be done by simply require the consumer to pass the reference into a method instead.</p>
<p>Yea, this is typically using double dispatch.</p>
<p>>> That is not completely true, “domain services” are apart of the domain itself, and have a very clear role in the domain.</p>
<p>Services is such an overused term and it&#8217;s unclear when to use it. Services in DDD are too undefined and can span various concepts. Thus violating single responsibility.</p>
<p>&#8220;Domain services&#8221; is close to what I&#8217;m doing but I&#8217;m using a slightly definition and different constraints to put it more in line with the UL and ensure separation of concerns.</p>
<p>I don&#8217;t couple any external operations to my transient domain objects. They are side-effect free, as Haskell people would call it. Therefore I don&#8217;t use an interface and I don&#8217;t bother with IoC because they contain only side-effect free domain logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Alsing</title>
		<link>http://blog.calyptus.eu/seb/2009/05/transitory_domain_object/comment-page-1/#comment-18</link>
		<dc:creator>Roger Alsing</dc:creator>
		<pubDate>Sat, 30 May 2009 20:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.calyptus.eu/?p=125#comment-18</guid>
		<description>I&#039;ve got a few remarks on this one:

&gt;&gt;The reference itself is (usually) infrastructure and not really a persistence concern.

Entities are not supposed to deal with persistence concerns, they are supposed to deal with _domain_ concerns.
The entire point of POCO is not have persistence concerns in the entities.

I do agree that keeping service references are an infrastructure concern, and should if possible be abstracted away.
In the easiest case it can be done by simply require the consumer to pass the reference into a method instead.
e.g. order.CalculateTotals(_someTaxCalculatorService_);

There are also other means to reach separation of concerns, eg AOP or introducing transient entities that operate over other entitie as you describe here.

&gt;&gt; Moving domain logic to services is a big no, no. That’s a gateway to anemic domain models 

That is not completely true, &quot;domain services&quot; are apart of the domain itself, and have a very clear role in the domain.
They keep functionallity that does not fit into an entity (persistent or transient) by the simple fact that it is an operation that is not associated with any sort of identity (persistent id or transient pointer/ref)
but is rather operating over a set of different entities.

I do however agree that moving functionallity that does belong in an entity is a big no no.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got a few remarks on this one:</p>
<p>&gt;&gt;The reference itself is (usually) infrastructure and not really a persistence concern.</p>
<p>Entities are not supposed to deal with persistence concerns, they are supposed to deal with _domain_ concerns.<br />
The entire point of POCO is not have persistence concerns in the entities.</p>
<p>I do agree that keeping service references are an infrastructure concern, and should if possible be abstracted away.<br />
In the easiest case it can be done by simply require the consumer to pass the reference into a method instead.<br />
e.g. order.CalculateTotals(_someTaxCalculatorService_);</p>
<p>There are also other means to reach separation of concerns, eg AOP or introducing transient entities that operate over other entitie as you describe here.</p>
<p>&gt;&gt; Moving domain logic to services is a big no, no. That’s a gateway to anemic domain models </p>
<p>That is not completely true, &#8220;domain services&#8221; are apart of the domain itself, and have a very clear role in the domain.<br />
They keep functionallity that does not fit into an entity (persistent or transient) by the simple fact that it is an operation that is not associated with any sort of identity (persistent id or transient pointer/ref)<br />
but is rather operating over a set of different entities.</p>
<p>I do however agree that moving functionallity that does belong in an entity is a big no no.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
