<?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: DDD, Repositories and ORMs</title>
	<atom:link href="http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Thu, 23 May 2013 23:40:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Milo Hyson</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-817</link>
		<dc:creator>Milo Hyson</dc:creator>
		<pubDate>Sat, 31 Oct 2009 05:21:51 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-817</guid>
		<description>@elguaro

You&#039;re assuming that all collections use a store-by-reference model in which only references to the objects are stored. There&#039;s nothing that says you cannot use a store-by-value model in which a copy of the object data is recorded. In such a case, simply use get() and set() methods with the latter adding or overwriting an object as appropriate.</description>
		<content:encoded><![CDATA[<p>@elguaro</p>
<p>You&#8217;re assuming that all collections use a store-by-reference model in which only references to the objects are stored. There&#8217;s nothing that says you cannot use a store-by-value model in which a copy of the object data is recorded. In such a case, simply use get() and set() methods with the latter adding or overwriting an object as appropriate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: elguaro</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-816</link>
		<dc:creator>elguaro</dc:creator>
		<pubDate>Sat, 21 Mar 2009 03:49:27 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-816</guid>
		<description>I think I&#039;m missing something very fundamental about DDD&#039;s repositories. How do you Update something inside it? A Repository is meant to behave like a collection which dont normally have an update method. 

The common approach seems to be you find the object you want first and set the new values on it. 

Customer customer = customerRepository.find(id);
customer.Name = newName;

The new name is later persisted by the Unit of Work. 

This bothers me because I have to do a get before I can update something. I should be able to just add an Update to the UofW (i.e NHibernate&#039;s Session.Update); but where can I do that if not in a Repository?

How do you handle updates?
</description>
		<content:encoded><![CDATA[<p>I think I&#8217;m missing something very fundamental about DDD&#8217;s repositories. How do you Update something inside it? A Repository is meant to behave like a collection which dont normally have an update method. </p>
<p>The common approach seems to be you find the object you want first and set the new values on it. </p>
<p>Customer customer = customerRepository.find(id);<br />
customer.Name = newName;</p>
<p>The new name is later persisted by the Unit of Work. </p>
<p>This bothers me because I have to do a get before I can update something. I should be able to just add an Update to the UofW (i.e NHibernate&#8217;s Session.Update); but where can I do that if not in a Repository?</p>
<p>How do you handle updates?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-815</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Tue, 23 Dec 2008 12:52:48 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-815</guid>
		<description>@mogadanez

Repositories are part of the domain, so I put the interfaces in MyApp.Domain.  Services are part of the domain, so I put at least domain services in MyApp.Domain.</description>
		<content:encoded><![CDATA[<p>@mogadanez</p>
<p>Repositories are part of the domain, so I put the interfaces in MyApp.Domain.  Services are part of the domain, so I put at least domain services in MyApp.Domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mogadanez</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-814</link>
		<dc:creator>mogadanez</dc:creator>
		<pubDate>Tue, 23 Dec 2008 07:21:53 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-814</guid>
		<description>how about physical separtaion?

for example if Enity &amp; Domain Services are not use Repositories – I want do it physically( put in separate assembly), not logically.

So, let’s me place repositories and Hibernate mapping in separate assembly( e.q. MyApp.Data, as in [SharpArchitectecture(http://code.google.com/p/sharp-architecture/) )

Where must I place repository interfaces? 1. MyApp.Data 2. MyApp.Model 3. Another, separate aseembly?</description>
		<content:encoded><![CDATA[<p>how about physical separtaion?</p>
<p>for example if Enity &#038; Domain Services are not use Repositories – I want do it physically( put in separate assembly), not logically.</p>
<p>So, let’s me place repositories and Hibernate mapping in separate assembly( e.q. MyApp.Data, as in [SharpArchitectecture(<a href="http://code.google.com/p/sharp-architecture/" rel="nofollow">http://code.google.com/p/sharp-architecture/</a>) )</p>
<p>Where must I place repository interfaces? 1. MyApp.Data 2. MyApp.Model 3. Another, separate aseembly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-813</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Mon, 13 Oct 2008 11:20:17 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-813</guid>
		<description>@Milo

Fair enough.  I think that&#039;s just semantics of the meaning of the word, not a representation of the concept.  It&#039;s clear that not every entity deserves its own Repository, namely child entities in an Aggregate.  That was the whole point of Colin&#039;s comment.</description>
		<content:encoded><![CDATA[<p>@Milo</p>
<p>Fair enough.  I think that&#8217;s just semantics of the meaning of the word, not a representation of the concept.  It&#8217;s clear that not every entity deserves its own Repository, namely child entities in an Aggregate.  That was the whole point of Colin&#8217;s comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Milo Hyson</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-812</link>
		<dc:creator>Milo Hyson</dc:creator>
		<pubDate>Mon, 13 Oct 2008 04:11:16 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-812</guid>
		<description>@bogardj

With all due respect, I don&#039;t think you&#039;re quite grasping the concept of an aggregate. According to both a standard English dictionary and Evans&#039; book, an aggregate is a combination of separate elements into a single unit. By that definition, a standalone element cannot be an aggregate.

As for the delineation of boundaries, standalone objects already do this. The creation of an additional border is only necessary when more than one object is involved. This allows enforcement of the group&#039;s internal cohesion. Standalone objects enforce their own cohesion.</description>
		<content:encoded><![CDATA[<p>@bogardj</p>
<p>With all due respect, I don&#8217;t think you&#8217;re quite grasping the concept of an aggregate. According to both a standard English dictionary and Evans&#8217; book, an aggregate is a combination of separate elements into a single unit. By that definition, a standalone element cannot be an aggregate.</p>
<p>As for the delineation of boundaries, standalone objects already do this. The creation of an additional border is only necessary when more than one object is involved. This allows enforcement of the group&#8217;s internal cohesion. Standalone objects enforce their own cohesion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-811</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Mon, 13 Oct 2008 02:43:58 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-811</guid>
		<description>@Milo

A standalone Entity is its own Aggregate, and Root.  The idea is that you have Entities, but Aggregates are how you draw boundaries around them.  Every Entity must belong to an Aggregate, and every Aggregate has a root.  That&#039;s how you arrive at the one Repository per Aggregate idea.</description>
		<content:encoded><![CDATA[<p>@Milo</p>
<p>A standalone Entity is its own Aggregate, and Root.  The idea is that you have Entities, but Aggregates are how you draw boundaries around them.  Every Entity must belong to an Aggregate, and every Aggregate has a root.  That&#8217;s how you arrive at the one Repository per Aggregate idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Milo Hyson</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-810</link>
		<dc:creator>Milo Hyson</dc:creator>
		<pubDate>Sun, 12 Oct 2008 23:23:34 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-810</guid>
		<description>@Colin Jack

I&#039;m a bit confused as to from where exactly the idea comes that &quot;only aggregate roots should have repositories.&quot; I have Evans&#039; book open in front of me as I type this, and I&#039;ll be damned if I can see anywhere he states this. It also makes no logical sense.

The purpose of a repository, as per Evans, is to provide a means of obtaining references to existing domain objects via global accessibility (as opposed to traversal from another object). Suppose that a given design contains no aggregates, but only simple entities without any embedded value objects. By your statement, no repositories should exist. How then is one to obtain references to the existing entities?</description>
		<content:encoded><![CDATA[<p>@Colin Jack</p>
<p>I&#8217;m a bit confused as to from where exactly the idea comes that &#8220;only aggregate roots should have repositories.&#8221; I have Evans&#8217; book open in front of me as I type this, and I&#8217;ll be damned if I can see anywhere he states this. It also makes no logical sense.</p>
<p>The purpose of a repository, as per Evans, is to provide a means of obtaining references to existing domain objects via global accessibility (as opposed to traversal from another object). Suppose that a given design contains no aggregates, but only simple entities without any embedded value objects. By your statement, no repositories should exist. How then is one to obtain references to the existing entities?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobin Harris</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-809</link>
		<dc:creator>Tobin Harris</dc:creator>
		<pubDate>Fri, 22 Aug 2008 05:59:46 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-809</guid>
		<description>@bogardj

Thanks for the pointers regarding transactions and repositories. I always liked the idea of transaction demarkation using attributes , which is now possible with Castle. E.g

[Transaction(Mode.Requires)]

@Colin

I&#039;ve always used Object Mother for setting up reference data in tests. The only thing is, if you have a lot of it, then you&#039;ll experience speed problems. 

In the case of a huge list of countries, you could always have an Object Mother method that only sets up 1 or 2 countries, which might be enough to satisfy the test case. Also, don&#039;t set it up in test fixtures that don&#039;t need it.


</description>
		<content:encoded><![CDATA[<p>@bogardj</p>
<p>Thanks for the pointers regarding transactions and repositories. I always liked the idea of transaction demarkation using attributes , which is now possible with Castle. E.g</p>
<p>[Transaction(Mode.Requires)]</p>
<p>@Colin</p>
<p>I&#8217;ve always used Object Mother for setting up reference data in tests. The only thing is, if you have a lot of it, then you&#8217;ll experience speed problems. </p>
<p>In the case of a huge list of countries, you could always have an Object Mother method that only sets up 1 or 2 countries, which might be enough to satisfy the test case. Also, don&#8217;t set it up in test fixtures that don&#8217;t need it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://lostechies.com/jimmybogard/2008/08/20/ddd-repositories-and-orms/#comment-808</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Thu, 21 Aug 2008 12:52:57 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/08/19/ddd-repositories-and-orms.aspx#comment-808</guid>
		<description>@Tobin
In-memory interests me but the issue is getting static/reference data in (e.g. lists of Countries) into the database? Thats always been the sticky point for me.

So far the repositories have just used HQL/Linq or, where necessary, SQL.

Does sound like you&#039;re going for something very similiar, be very interested to hear you get on.

I&#039;d also be interested to hear what others are doing regarding clients always talkin to app services. I&#039;ve tended let the apps talk to the domain directly where applicable but I&#039;d be interested in hearing how you and Jimmy approach this.</description>
		<content:encoded><![CDATA[<p>@Tobin<br />
In-memory interests me but the issue is getting static/reference data in (e.g. lists of Countries) into the database? Thats always been the sticky point for me.</p>
<p>So far the repositories have just used HQL/Linq or, where necessary, SQL.</p>
<p>Does sound like you&#8217;re going for something very similiar, be very interested to hear you get on.</p>
<p>I&#8217;d also be interested to hear what others are doing regarding clients always talkin to app services. I&#8217;ve tended let the apps talk to the domain directly where applicable but I&#8217;d be interested in hearing how you and Jimmy approach this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
