<?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: ALT.NET DDD Podcast</title>
	<atom:link href="http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/</link>
	<description>Enterprise Development Expert &#38; SOA Specialist</description>
	<lastBuildDate>Sat, 11 Feb 2012 15:16:10 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36106</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Mon, 20 Apr 2009 18:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36106</guid>
		<description>Nice post Mario. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Nice post Mario. Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Pareja</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36105</link>
		<dc:creator>Mario Pareja</dc:creator>
		<pubDate>Mon, 20 Apr 2009 15:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36105</guid>
		<description>Edward,

I just wanted to elaborate a bit on Udi&#039;s comment to give you a hand in understanding how you could accomplish this and keep your domain model free of these concerns.  As I wrote my response, I realized I had enough material for a simple blog post, so I will redirect you to it:

http://www.mariopareja.com/blog/post/2009/04/20/How-To-Avoid-Accessing-Repositories-from-Domain-Objects.aspx

I am not sure why your CreateOrder method would need to load products from the repository.  Wouldn&#039;t you be adding (ie. passing in) products to the order?  Anyway, the post puts forth a slightly different (and obviously contrived) example.</description>
		<content:encoded><![CDATA[<p>Edward,</p>
<p>I just wanted to elaborate a bit on Udi&#8217;s comment to give you a hand in understanding how you could accomplish this and keep your domain model free of these concerns.  As I wrote my response, I realized I had enough material for a simple blog post, so I will redirect you to it:</p>
<p><a href="http://www.mariopareja.com/blog/post/2009/04/20/How-To-Avoid-Accessing-Repositories-from-Domain-Objects.aspx" rel="nofollow">http://www.mariopareja.com/blog/post/2009/04/20/How-To-Avoid-Accessing-Repositories-from-Domain-Objects.aspx</a></p>
<p>I am not sure why your CreateOrder method would need to load products from the repository.  Wouldn&#8217;t you be adding (ie. passing in) products to the order?  Anyway, the post puts forth a slightly different (and obviously contrived) example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36068</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Mon, 09 Mar 2009 22:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36068</guid>
		<description>Edward,

I&#039;m actually against objects in the domain model accessing repositories, or IoC containers. In other words, they don&#039;t &quot;need to access, say, a Repository&quot;.

One of the ways to keep the domain clear of that is for the service layer to retrieve all needed objects itself and pass those into the domain.

Does that help at all?</description>
		<content:encoded><![CDATA[<p>Edward,</p>
<p>I&#8217;m actually against objects in the domain model accessing repositories, or IoC containers. In other words, they don&#8217;t &#8220;need to access, say, a Repository&#8221;.</p>
<p>One of the ways to keep the domain clear of that is for the service layer to retrieve all needed objects itself and pass those into the domain.</p>
<p>Does that help at all?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edward</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36059</link>
		<dc:creator>Edward</dc:creator>
		<pubDate>Thu, 05 Mar 2009 15:24:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36059</guid>
		<description>&quot;So, yes, I’d say that by and large, domain objects are free of this concern.&quot;

Until they need to access, say, a Repository.  It is my understanding that the repository interface is part of the domain, however the implementations are infrastructure concerns and so will be provided via DI. 

Would this be fair to say?  

If so, and an Order took an IProductRepository as a constructor parameter, this either places a dependency on IProductRepository on the Order class (or CreateOrder method), or the CreateOrder method actually calls IoC to get an instance of an IProductRepository.  

But Domain should not be calling IoC?  If it doesn&#039;t, then we end up passing lots of dependencies around the place just because one method or constructor requires it deep within the object graph or deep within the call stack.

I don&#039;t know what I&#039;m actually asking here, it&#039;s more a illustration of how I don&#039;t quite &#039;get&#039; how we isolate the domain while keeping it usable, and also patterns for IoC usage within DDD focused applications.</description>
		<content:encoded><![CDATA[<p>&#8220;So, yes, I’d say that by and large, domain objects are free of this concern.&#8221;</p>
<p>Until they need to access, say, a Repository.  It is my understanding that the repository interface is part of the domain, however the implementations are infrastructure concerns and so will be provided via DI. </p>
<p>Would this be fair to say?  </p>
<p>If so, and an Order took an IProductRepository as a constructor parameter, this either places a dependency on IProductRepository on the Order class (or CreateOrder method), or the CreateOrder method actually calls IoC to get an instance of an IProductRepository.  </p>
<p>But Domain should not be calling IoC?  If it doesn&#8217;t, then we end up passing lots of dependencies around the place just because one method or constructor requires it deep within the object graph or deep within the call stack.</p>
<p>I don&#8217;t know what I&#8217;m actually asking here, it&#8217;s more a illustration of how I don&#8217;t quite &#8216;get&#8217; how we isolate the domain while keeping it usable, and also patterns for IoC usage within DDD focused applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Domain Driven Design: A Step by Step Guide - DDD Step By Step - DDD: Step By Step</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36040</link>
		<dc:creator>Domain Driven Design: A Step by Step Guide - DDD Step By Step - DDD: Step By Step</dc:creator>
		<pubDate>Sun, 22 Feb 2009 20:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36040</guid>
		<description>[...] deliberate omission, I heartily recommend you read stuff by Jimmy Nilsson, Greg Young, Colin Jack, Udi Dahan and of course Eric [...]</description>
		<content:encoded><![CDATA[<p>[...] deliberate omission, I heartily recommend you read stuff by Jimmy Nilsson, Greg Young, Colin Jack, Udi Dahan and of course Eric [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Domain Driven Design: A Step by Step Guide - Casey Charlton - Insane World</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36016</link>
		<dc:creator>Domain Driven Design: A Step by Step Guide - Casey Charlton - Insane World</dc:creator>
		<pubDate>Tue, 10 Feb 2009 20:05:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36016</guid>
		<description>[...] deliberate omission, I heartily recommend you read stuff by Jimmy Nilsson, Greg Young, Colin Jack, Udi Dahan and of course Eric [...]</description>
		<content:encoded><![CDATA[<p>[...] deliberate omission, I heartily recommend you read stuff by Jimmy Nilsson, Greg Young, Colin Jack, Udi Dahan and of course Eric [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36006</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Wed, 04 Feb 2009 09:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36006</guid>
		<description>Bryan,

You&#039;re looking at how to extend the behavior of the system, but from the domain model out. Often, the best way to extend a system is &quot;around the edges&quot; by adding an additional bounded context.

So, yes, I&#039;d say that by and large, domain objects are free of this concern.</description>
		<content:encoded><![CDATA[<p>Bryan,</p>
<p>You&#8217;re looking at how to extend the behavior of the system, but from the domain model out. Often, the best way to extend a system is &#8220;around the edges&#8221; by adding an additional bounded context.</p>
<p>So, yes, I&#8217;d say that by and large, domain objects are free of this concern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Watts</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-36001</link>
		<dc:creator>Bryan Watts</dc:creator>
		<pubDate>Tue, 03 Feb 2009 15:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-36001</guid>
		<description>Udi,

Thanks for the clarification. Let me say it back to you, and please correct me if I am wrong.

You appear to be saying the domain itself does not need to support external extension, i.e. if there is a derived type such as GovernmentUser, it will *also* be part of the domain.

This of course makes sense - the domain encompasses all aspects of the problem.

I am trying to alleviate a nagging technical concern: &quot;leave room for unknown derived types&quot;.

Would you say that domain objects are free of this concern?</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>Thanks for the clarification. Let me say it back to you, and please correct me if I am wrong.</p>
<p>You appear to be saying the domain itself does not need to support external extension, i.e. if there is a derived type such as GovernmentUser, it will *also* be part of the domain.</p>
<p>This of course makes sense &#8211; the domain encompasses all aspects of the problem.</p>
<p>I am trying to alleviate a nagging technical concern: &#8220;leave room for unknown derived types&#8221;.</p>
<p>Would you say that domain objects are free of this concern?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35999</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Tue, 03 Feb 2009 09:37:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35999</guid>
		<description>Nuno,

I myself was interpreting comments made by someone else so we&#039;re both in the same boat here :)</description>
		<content:encoded><![CDATA[<p>Nuno,</p>
<p>I myself was interpreting comments made by someone else so we&#8217;re both in the same boat here <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35998</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Tue, 03 Feb 2009 09:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35998</guid>
		<description>Bryan,

Domain model objects are designed to collaborate with each other intensely in their implementation of business rules. They should not be talking to anything else outside the domain, thus there is no need for DI in there. For that reason, there is no technical reason that one domain object cannot instantiate another directly (although we should NOT be seeing A instantiating B as well as B instantiating A).</description>
		<content:encoded><![CDATA[<p>Bryan,</p>
<p>Domain model objects are designed to collaborate with each other intensely in their implementation of business rules. They should not be talking to anything else outside the domain, thus there is no need for DI in there. For that reason, there is no technical reason that one domain object cannot instantiate another directly (although we should NOT be seeing A instantiating B as well as B instantiating A).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35994</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Mon, 02 Feb 2009 21:39:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35994</guid>
		<description>&quot;Separating all of this logic into different bounded contexts makes sense.

That is, until you think about how you’re going to take these and stitch out of them a single result shown to the user. This is the advanced side of DDD and ties into SOA, so I’ll leave it for a different post.&quot;

I guess introducing a third bounded context here seems complex to me, but I&#039;m wondering if I have a different interpretation of bounded context than you. To me if generating taxes relates specifically to ordering, and if you don&#039;t have the signs of a bounded context waiting to appear (false cognates and duplicate concepts), then just having a seperate set of classes or a seperate module seems like it&#039;d be a good option.

Very interested in reading more though, especially as to how it relates to your SOA boundaries.</description>
		<content:encoded><![CDATA[<p>&#8220;Separating all of this logic into different bounded contexts makes sense.</p>
<p>That is, until you think about how you’re going to take these and stitch out of them a single result shown to the user. This is the advanced side of DDD and ties into SOA, so I’ll leave it for a different post.&#8221;</p>
<p>I guess introducing a third bounded context here seems complex to me, but I&#8217;m wondering if I have a different interpretation of bounded context than you. To me if generating taxes relates specifically to ordering, and if you don&#8217;t have the signs of a bounded context waiting to appear (false cognates and duplicate concepts), then just having a seperate set of classes or a seperate module seems like it&#8217;d be a good option.</p>
<p>Very interested in reading more though, especially as to how it relates to your SOA boundaries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nuno Lopes</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35991</link>
		<dc:creator>Nuno Lopes</dc:creator>
		<pubDate>Sat, 31 Jan 2009 01:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35991</guid>
		<description>It&#039;s difficult to use a Domain as an examples when the Domain is hypotethical but I&#039;ll try.

I don&#039;t know if that is the way to go either especially in a broad spectrum e-commerce application. Let me explain using some other &quot;pre DDD&quot; principles :)

When analysing the Domain one may come to the conclusion that there is a one to one mapping between Customer(Role of a User), User and Account. If that is the case one may fold the three of them into one class and call it whatever it makes more sense for the Domain (say User). 

But what if there isn&#039;t a one to one mapping between them? This is very common in E-Procurement systems. Would you ask the customer, would you ask the account or would you ask the user to create an order?

Tricky no? Not really :)

Use the class that is the most representetive of the party envolved in the business transaction. It may well be the Account.

Furthemore think very well if one needs to subclass the Customer (say GovernementCustomer). You may end up with a bloated and rigid model (FederalGovernmentCustomer, LocalGovernementCustomer, etc etc etc). One may simple need an OrderDescription class (http://knol.google.com/k/stephen-palmer/the-description-class-archetype/3e0t9wv30hso7/6#)

So we would do something like:

IOrderDescription od = OrderDescRep.Load(acc)
aOrderDescription.MakeOrder(acc, // data //).

If OrderDescription starts being too limited but still generalisable to a sub class of customers is preferable to start  subclassing the OrderDescription then Account (say GovernmentOrderDescription).

Cheers</description>
		<content:encoded><![CDATA[<p>It&#8217;s difficult to use a Domain as an examples when the Domain is hypotethical but I&#8217;ll try.</p>
<p>I don&#8217;t know if that is the way to go either especially in a broad spectrum e-commerce application. Let me explain using some other &#8220;pre DDD&#8221; principles <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>When analysing the Domain one may come to the conclusion that there is a one to one mapping between Customer(Role of a User), User and Account. If that is the case one may fold the three of them into one class and call it whatever it makes more sense for the Domain (say User). </p>
<p>But what if there isn&#8217;t a one to one mapping between them? This is very common in E-Procurement systems. Would you ask the customer, would you ask the account or would you ask the user to create an order?</p>
<p>Tricky no? Not really <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Use the class that is the most representetive of the party envolved in the business transaction. It may well be the Account.</p>
<p>Furthemore think very well if one needs to subclass the Customer (say GovernementCustomer). You may end up with a bloated and rigid model (FederalGovernmentCustomer, LocalGovernementCustomer, etc etc etc). One may simple need an OrderDescription class (<a href="http://knol.google.com/k/stephen-palmer/the-description-class-archetype/3e0t9wv30hso7/6#" rel="nofollow">http://knol.google.com/k/stephen-palmer/the-description-class-archetype/3e0t9wv30hso7/6#</a>)</p>
<p>So we would do something like:</p>
<p>IOrderDescription od = OrderDescRep.Load(acc)<br />
aOrderDescription.MakeOrder(acc, // data //).</p>
<p>If OrderDescription starts being too limited but still generalisable to a sub class of customers is preferable to start  subclassing the OrderDescription then Account (say GovernmentOrderDescription).</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Watts</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35985</link>
		<dc:creator>Bryan Watts</dc:creator>
		<pubDate>Fri, 30 Jan 2009 02:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35985</guid>
		<description>Udi,

Thanks for your response.

&gt; I’m not quite sure what a DI violation is.

I simply meant invoking a concrete constructor, which carries a certain stigma.

&gt; I can say that the dependency inversion principle doesn’t provide much value within a domain model.

Would you elaborate? I am unsure of the impact of technical patterns like DI on the development of domain objects.

&gt; Also, not quite sure how building cars in parking garages relates

It was an argument for keeping factories and repositories separate: you don&#039;t generally store something the same place you build it.</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>Thanks for your response.</p>
<p>&gt; I’m not quite sure what a DI violation is.</p>
<p>I simply meant invoking a concrete constructor, which carries a certain stigma.</p>
<p>&gt; I can say that the dependency inversion principle doesn’t provide much value within a domain model.</p>
<p>Would you elaborate? I am unsure of the impact of technical patterns like DI on the development of domain objects.</p>
<p>&gt; Also, not quite sure how building cars in parking garages relates</p>
<p>It was an argument for keeping factories and repositories separate: you don&#8217;t generally store something the same place you build it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35984</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Thu, 29 Jan 2009 23:02:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35984</guid>
		<description>Bryan,

The CreateOrder method on the specific user classes (like GovernmentUser) would directly instantiate Order.

I&#039;m not quite sure what a DI violation is.

I can say that the dependency inversion principle doesn&#039;t provide much value within a domain model.

Also, not quite sure how building cars in parking garages relates :)

Thanks for your comments though and interested in hearing your response.</description>
		<content:encoded><![CDATA[<p>Bryan,</p>
<p>The CreateOrder method on the specific user classes (like GovernmentUser) would directly instantiate Order.</p>
<p>I&#8217;m not quite sure what a DI violation is.</p>
<p>I can say that the dependency inversion principle doesn&#8217;t provide much value within a domain model.</p>
<p>Also, not quite sure how building cars in parking garages relates <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for your comments though and interested in hearing your response.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tobsen</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35979</link>
		<dc:creator>tobsen</dc:creator>
		<pubDate>Tue, 27 Jan 2009 17:40:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35979</guid>
		<description>Nice comment Bryan Watts. I&#039;ll remember &quot;you don’t build cars in the parking garage.&quot;</description>
		<content:encoded><![CDATA[<p>Nice comment Bryan Watts. I&#8217;ll remember &#8220;you don’t build cars in the parking garage.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Hart</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35975</link>
		<dc:creator>Michael Hart</dc:creator>
		<pubDate>Tue, 27 Jan 2009 00:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35975</guid>
		<description>Nice advice - I think most people assume that a Factory needs to be a separate object, but Evans discusses this on p139-140:

&quot;... if you needed to add elements inside a pre-existing Aggregate, you might create a Factory Method on the root of the Aggregate... Another example would be to place a Factory Method on an object that is closely involved in spawning another object, although it doesn&#039;t own the product once it is created. When the data and possibly the rules of one object are very dominant in the creation of an object, this saves pulling information out of the spawner to be used elsewhere to create the object. It also communicates the special relationship between the spawner and the product.&quot;

He then goes on to give an example of Brokerage Accounts having control over the creation of Trade Orders (due to knowledge of allowance rules and initial population data), even though they are not part of the same Aggregates.

Always hard to keep these things in mind though...</description>
		<content:encoded><![CDATA[<p>Nice advice &#8211; I think most people assume that a Factory needs to be a separate object, but Evans discusses this on p139-140:</p>
<p>&#8220;&#8230; if you needed to add elements inside a pre-existing Aggregate, you might create a Factory Method on the root of the Aggregate&#8230; Another example would be to place a Factory Method on an object that is closely involved in spawning another object, although it doesn&#8217;t own the product once it is created. When the data and possibly the rules of one object are very dominant in the creation of an object, this saves pulling information out of the spawner to be used elsewhere to create the object. It also communicates the special relationship between the spawner and the product.&#8221;</p>
<p>He then goes on to give an example of Brokerage Accounts having control over the creation of Trade Orders (due to knowledge of allowance rules and initial population data), even though they are not part of the same Aggregates.</p>
<p>Always hard to keep these things in mind though&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Watts</title>
		<link>http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/comment-page-1/#comment-35971</link>
		<dc:creator>Bryan Watts</dc:creator>
		<pubDate>Mon, 26 Jan 2009 21:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/2009/01/26/altnet-ddd-podcast/#comment-35971</guid>
		<description>This brings up a core question about DDD for me: would CreateOrder directly instantiate Order, or would it use a factory?

If it doesn&#039;t use a factory, is that a DI violation?

If it does use a factory, does User take a factory reference? Is that an appropriate level of knowledge for an aggregate root, or any non-service domain object?

I am inclined to think that factories are appropriate in all cases. They are solely responsible for expressing object creation (and algorithmic differences, such as with GovernmentUser).

Factories and repositories are separate components of an entity&#039;s conceptual lifetime. Combining them by definition violates SRP and really only makes technical sense; you don&#039;t build cars in the parking garage.</description>
		<content:encoded><![CDATA[<p>This brings up a core question about DDD for me: would CreateOrder directly instantiate Order, or would it use a factory?</p>
<p>If it doesn&#8217;t use a factory, is that a DI violation?</p>
<p>If it does use a factory, does User take a factory reference? Is that an appropriate level of knowledge for an aggregate root, or any non-service domain object?</p>
<p>I am inclined to think that factories are appropriate in all cases. They are solely responsible for expressing object creation (and algorithmic differences, such as with GovernmentUser).</p>
<p>Factories and repositories are separate components of an entity&#8217;s conceptual lifetime. Combining them by definition violates SRP and really only makes technical sense; you don&#8217;t build cars in the parking garage.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

