<?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: Factory and Repository in the Domain</title>
	<atom:link href="http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/feed/" rel="self" type="application/rss+xml" />
	<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/</link>
	<description>// TODO: think of a witty and intelligent tagline</description>
	<pubDate>Thu, 18 Mar 2010 05:32:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Lyronne Rangan</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-781</link>
		<dc:creator>Lyronne Rangan</dc:creator>
		<pubDate>Wed, 31 Dec 2008 12:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-781</guid>
		<description>As far as I understand, you would define one repository per aggregate root and defining the aggregate boundaries in a model will cause a dramatic reduction in the amount of repositories rather than an over complication. I don't see how datamapper and repository are mutually exclusive choices. A repository is supposed to behave like an in memory collection of objects, those objects being aggregates. The repository need only expose queries to the aggregates and we navigate down the graph from the root. This view promotes the enriching of the model because it forces you to use the relationships, or a query object to retrieve chidren of interest from the aggregate root. A datamapper typically deals with a class or family of classes. In the case of value objects perhaps used in more than one aggregate, it would have it's own datamapper. It can... if you enforce the unidirectional relationship (which evans promotes) between the value object and it's parent because a bi-directional one may not make sense. So you could use the same datamapper in more than one repository. Here I see the repository as the lasting concept and the datamapper as a transient one. Even through I use datamapper my UnitOfWork only knows about an IPersistence interface when we are ready to commit object changes.</description>
		<content:encoded><![CDATA[<p>As far as I understand, you would define one repository per aggregate root and defining the aggregate boundaries in a model will cause a dramatic reduction in the amount of repositories rather than an over complication. I don&#8217;t see how datamapper and repository are mutually exclusive choices. A repository is supposed to behave like an in memory collection of objects, those objects being aggregates. The repository need only expose queries to the aggregates and we navigate down the graph from the root. This view promotes the enriching of the model because it forces you to use the relationships, or a query object to retrieve chidren of interest from the aggregate root. A datamapper typically deals with a class or family of classes. In the case of value objects perhaps used in more than one aggregate, it would have it&#8217;s own datamapper. It can&#8230; if you enforce the unidirectional relationship (which evans promotes) between the value object and it&#8217;s parent because a bi-directional one may not make sense. So you could use the same datamapper in more than one repository. Here I see the repository as the lasting concept and the datamapper as a transient one. Even through I use datamapper my UnitOfWork only knows about an IPersistence interface when we are ready to commit object changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Fernandes</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-779</link>
		<dc:creator>Daniel Fernandes</dc:creator>
		<pubDate>Wed, 24 Dec 2008 00:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-779</guid>
		<description>A year ago on my first attempt to do DDD (the idea sounded good and strangely simple) I did the mistake of creating too many packages and was afraid of giving access to Repositories from the Domain Model.
I think there is indeed a lot of misunderstanding in that some people understand Domain Model as being "the" Domain.
In simplifying DDD by doing so we can only end up with a more anemic model that one might expect.
My guess is that asynchronous operations should be dealt in a diffeerent maner, probably by using Domain messaging which is simple in itself to implement.

Daniel Fernandes</description>
		<content:encoded><![CDATA[<p>A year ago on my first attempt to do DDD (the idea sounded good and strangely simple) I did the mistake of creating too many packages and was afraid of giving access to Repositories from the Domain Model.<br />
I think there is indeed a lot of misunderstanding in that some people understand Domain Model as being &#8220;the&#8221; Domain.<br />
In simplifying DDD by doing so we can only end up with a more anemic model that one might expect.<br />
My guess is that asynchronous operations should be dealt in a diffeerent maner, probably by using Domain messaging which is simple in itself to implement.</p>
<p>Daniel Fernandes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Payer</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-778</link>
		<dc:creator>Martin Payer</dc:creator>
		<pubDate>Fri, 12 Dec 2008 21:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-778</guid>
		<description>Who says that ojbects of domain layer aren't allowed to hold references on DAOs? In every layered architecture I've seen DAOs were in the infrastructure layer. Domain objects are in domain layer. Infrastructure layer is below domain layer. In Eric Evans DDD there is even an example where an association between two model objects is expressed by a getCollection() method that executes a query directly.</description>
		<content:encoded><![CDATA[<p>Who says that ojbects of domain layer aren&#8217;t allowed to hold references on DAOs? In every layered architecture I&#8217;ve seen DAOs were in the infrastructure layer. Domain objects are in domain layer. Infrastructure layer is below domain layer. In Eric Evans DDD there is even an example where an association between two model objects is expressed by a getCollection() method that executes a query directly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Hutchison</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-748</link>
		<dc:creator>Ben Hutchison</dc:creator>
		<pubDate>Tue, 25 Mar 2008 03:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-748</guid>
		<description>Yes, Yes, Yes. We need this said more often.

Its good to see the tide turning against the flawed idea that you can have a domain model thats both behaviorally rich and yet never initiates interaction with the world around it.

Other than domain -&#62; repository access, the other archetypal case of useful domain -&#62; service access are services that listen to domain events. Eg you might want to send an email to Prod Support when a BankAccount becomes illegally overdrawn.

In my Spring/Hibernate-flavored enterprise world, support for injecting into domain objects is still a practical sticking point. My colleagues oppose the AOP-based weaving model provided by Spring 2.0 as too much "techno-magic".</description>
		<content:encoded><![CDATA[<p>Yes, Yes, Yes. We need this said more often.</p>
<p>Its good to see the tide turning against the flawed idea that you can have a domain model thats both behaviorally rich and yet never initiates interaction with the world around it.</p>
<p>Other than domain -&gt; repository access, the other archetypal case of useful domain -&gt; service access are services that listen to domain events. Eg you might want to send an email to Prod Support when a BankAccount becomes illegally overdrawn.</p>
<p>In my Spring/Hibernate-flavored enterprise world, support for injecting into domain objects is still a practical sticking point. My colleagues oppose the AOP-based weaving model provided by Spring 2.0 as too much &#8220;techno-magic&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Pawson</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-703</link>
		<dc:creator>Richard Pawson</dc:creator>
		<pubDate>Fri, 07 Dec 2007 15:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-703</guid>
		<description>Glad to see someone denouncing the dominant design of putting all the business logic in the transaction scripts  -  get it back on the domain objects where it belongs.

You say 'The transaction script (e.g. struts action in a web application if you’re so inclined) is simply responsible for finding an appropriate entry-point into the domain, then telling that domain class to do some work.'

Are you aware of Naked Objects  -  we've taken this to the extreme, whereby you don't have any (developer-written) controllers at all.  The framework provides you with direct access to the domain objects and their public methods.  I think you'd love it.  And to get you to the domain objects, we simply provide the user with direct access to (a subset of methods on) the Repositories, which we use in exactly the same way that you do.  

I'd be interested to hear your reactions to this idea.

Richard</description>
		<content:encoded><![CDATA[<p>Glad to see someone denouncing the dominant design of putting all the business logic in the transaction scripts  -  get it back on the domain objects where it belongs.</p>
<p>You say &#8216;The transaction script (e.g. struts action in a web application if you’re so inclined) is simply responsible for finding an appropriate entry-point into the domain, then telling that domain class to do some work.&#8217;</p>
<p>Are you aware of Naked Objects  -  we&#8217;ve taken this to the extreme, whereby you don&#8217;t have any (developer-written) controllers at all.  The framework provides you with direct access to the domain objects and their public methods.  I think you&#8217;d love it.  And to get you to the domain objects, we simply provide the user with direct access to (a subset of methods on) the Repositories, which we use in exactly the same way that you do.  </p>
<p>I&#8217;d be interested to hear your reactions to this idea.</p>
<p>Richard</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-702</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 07 Dec 2007 06:53:40 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-702</guid>
		<description>Reminds me of this recent post by Philip Calcado: http://fragmental.tw/2007/11/29/repositories-misunderstandings/</description>
		<content:encoded><![CDATA[<p>Reminds me of this recent post by Philip Calcado: <a href="http://fragmental.tw/2007/11/29/repositories-misunderstandings/" rel="nofollow">http://fragmental.tw/2007/11/29/repositories-misunderstandings/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Geyer</title>
		<link>http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/comment-page-1/#comment-701</link>
		<dc:creator>Ben Geyer</dc:creator>
		<pubDate>Fri, 07 Dec 2007 04:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://evan.bottch.com/2007/12/06/factory-and-repository-in-the-domain/#comment-701</guid>
		<description>Great post.  I strongly identify with your experiences and it gives me more to think about.  Thanks!</description>
		<content:encoded><![CDATA[<p>Great post.  I strongly identify with your experiences and it gives me more to think about.  Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
