<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Comments to Gavin King about DDD and Repositories</title>
	<atom:link href="http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/feed/" rel="self" type="application/rss+xml" />
	<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/</link>
	<description>better than writing good code is deleting code</description>
	<lastBuildDate>Sun, 07 Mar 2010 16:36:52 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Fabio Kung</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-117</link>
		<dc:creator>Fabio Kung</dc:creator>
		<pubDate>Mon, 27 Oct 2008 15:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-117</guid>
		<description>@lonelybug

Interesting use!</description>
		<content:encoded><![CDATA[<p>@lonelybug</p>
<p>Interesting use!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lonelybug</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-116</link>
		<dc:creator>lonelybug</dc:creator>
		<pubDate>Mon, 27 Oct 2008 05:21:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-116</guid>
		<description>i see what&#039;s you mean. here is one important advantage as you apply Repository rather than DAO. one more layer -- Repository, between Dao and Aggregate Entitry, which bring some flexiblity, for example, the cache or the concentration access point.

for example if apply the Dao, then the client (caller) need to understand and learn some complicated detail or Dao objects.

the codes should looks like:

Client c=new Client(clientDao).

if you do others, you also have to know the related Daos for those entities.

but for Repository.

the repository just apply for root entity for an aggregate.

so there are more less repository need to learn or even you can apply repository factory pattern.

codes looks like:

Client c=new Client(RepositoryFactory.getInstance())

within the Client:

Client(factory){
  repository=factory.getRepository(Client.class);
}

hope can help you a little.</description>
		<content:encoded><![CDATA[<p>i see what&#8217;s you mean. here is one important advantage as you apply Repository rather than DAO. one more layer &#8212; Repository, between Dao and Aggregate Entitry, which bring some flexiblity, for example, the cache or the concentration access point.</p>
<p>for example if apply the Dao, then the client (caller) need to understand and learn some complicated detail or Dao objects.</p>
<p>the codes should looks like:</p>
<p>Client c=new Client(clientDao).</p>
<p>if you do others, you also have to know the related Daos for those entities.</p>
<p>but for Repository.</p>
<p>the repository just apply for root entity for an aggregate.</p>
<p>so there are more less repository need to learn or even you can apply repository factory pattern.</p>
<p>codes looks like:</p>
<p>Client c=new Client(RepositoryFactory.getInstance())</p>
<p>within the Client:</p>
<p>Client(factory){<br />
  repository=factory.getRepository(Client.class);<br />
}</p>
<p>hope can help you a little.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-30</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Sat, 24 Nov 2007 16:37:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-30</guid>
		<description>Is this just a variety on the Transaciton Script approach?</description>
		<content:encoded><![CDATA[<p>Is this just a variety on the Transaciton Script approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-29</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Sat, 24 Nov 2007 13:43:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-29</guid>
		<description>@Dietmar: Wonderful! I&#039;ve also implemented a large application with the business logic in commands and the data in objects. This was very useful and it was very easy to recombine and reuse commands for new business cases. I&#039;ll certainly take a look at tiny marbles.</description>
		<content:encoded><![CDATA[<p>@Dietmar: Wonderful! I&#8217;ve also implemented a large application with the business logic in commands and the data in objects. This was very useful and it was very easy to recombine and reuse commands for new business cases. I&#8217;ll certainly take a look at tiny marbles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dietmar Temps</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-28</link>
		<dc:creator>Dietmar Temps</dc:creator>
		<pubDate>Sat, 24 Nov 2007 13:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-28</guid>
		<description>@Stephan: It is interesting to read a comment like this. I&#039;m a member of an Open Source project, called Tiny Marbles (http://www.tinymarbles.org). We are following a similar approach: we store objects in a repository. There are CRUD methods for the objects, that&#039;s almost all. The complete business logic we encapsulate using the Command pattern. I wouldn&#039;t say, that this approach would fit in every software project, but in a web application environment for business applications it is just wonderful. And it fits perfectly well to a RESTful architecture.

The discussion here shows one thing very clearly: who says, the decision that &#039;getOrders&#039; is connected to &#039;Client&#039; is a good decision? Sometimes when starting the project the requirements are not known completely. At least while developing web application where requirements can change very often, it seems to me a better approach to maintain a stable domain model (which we do in our case in the Tiny Marbles repository), and delegate the business logic to &#039;services&#039; (in our case using the Command pattern) which changes the state of the repository, or simply gives filtered information about the current state of the system. For the example you mentioned in your post we would prefer: getRepo.OrdersSinceDate(User, date). And we even go one step further: we are using the object &#039;User&#039; with the role &#039;customer&#039; or &#039;client&#039;.

@Fabio: I would love to discuss our philosophy with you, although I know, you don&#039;t agree and this place might not the right board for that. But hopefully some day there will be an opportunity :)</description>
		<content:encoded><![CDATA[<p>@Stephan: It is interesting to read a comment like this. I&#8217;m a member of an Open Source project, called Tiny Marbles (<a href="http://www.tinymarbles.org" rel="nofollow">http://www.tinymarbles.org</a>). We are following a similar approach: we store objects in a repository. There are CRUD methods for the objects, that&#8217;s almost all. The complete business logic we encapsulate using the Command pattern. I wouldn&#8217;t say, that this approach would fit in every software project, but in a web application environment for business applications it is just wonderful. And it fits perfectly well to a RESTful architecture.</p>
<p>The discussion here shows one thing very clearly: who says, the decision that &#8216;getOrders&#8217; is connected to &#8216;Client&#8217; is a good decision? Sometimes when starting the project the requirements are not known completely. At least while developing web application where requirements can change very often, it seems to me a better approach to maintain a stable domain model (which we do in our case in the Tiny Marbles repository), and delegate the business logic to &#8217;services&#8217; (in our case using the Command pattern) which changes the state of the repository, or simply gives filtered information about the current state of the system. For the example you mentioned in your post we would prefer: getRepo.OrdersSinceDate(User, date). And we even go one step further: we are using the object &#8216;User&#8217; with the role &#8216;customer&#8217; or &#8216;client&#8217;.</p>
<p>@Fabio: I would love to discuss our philosophy with you, although I know, you don&#8217;t agree and this place might not the right board for that. But hopefully some day there will be an opportunity <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-27</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Wed, 21 Nov 2007 05:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-27</guid>
		<description>@Fabio: No I&#039;m not. After 20 years of developing applications with OO I think it&#039;s not the best way. From my experience FOOP is easier to refactor, easier to understand, easier to reuse and easier to maintain in the long run. Perhaps I have to blog an example to make people understand.

Peace
-stephan</description>
		<content:encoded><![CDATA[<p>@Fabio: No I&#8217;m not. After 20 years of developing applications with OO I think it&#8217;s not the best way. From my experience FOOP is easier to refactor, easier to understand, easier to reuse and easier to maintain in the long run. Perhaps I have to blog an example to make people understand.</p>
<p>Peace<br />
-stephan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio Kung</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-26</link>
		<dc:creator>Fabio Kung</dc:creator>
		<pubDate>Tue, 20 Nov 2007 23:15:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-26</guid>
		<description>@Stephan

You are just kidding, right?</description>
		<content:encoded><![CDATA[<p>@Stephan</p>
<p>You are just kidding, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-25</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Tue, 20 Nov 2007 18:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-25</guid>
		<description>&quot;It feels too much procedural.&quot;

In fact, after 20 years of OO I think OO is step in the wrong direction. Procedural is good. My programming style is FOOP. My methods aim to be functional, meaning they have no side effects and don&#039;t change state as much as possible. My objects just carry the data around and have some convenience methods for manipulating the data. All business logic is encapsulated in services, which are procedural and stateless. So my programming style is FOOP. Functional-OO-Procedural.

Really, it&#039;s the future :-)

Peace
-stephan

--
Stephan Schmidt :: stephan@reposita.org
Reposita Open Source - Monitor your software development
http://www.reposita.org
Blog at http://stephan.reposita.org - No signal. No noise.</description>
		<content:encoded><![CDATA[<p>&#8220;It feels too much procedural.&#8221;</p>
<p>In fact, after 20 years of OO I think OO is step in the wrong direction. Procedural is good. My programming style is FOOP. My methods aim to be functional, meaning they have no side effects and don&#8217;t change state as much as possible. My objects just carry the data around and have some convenience methods for manipulating the data. All business logic is encapsulated in services, which are procedural and stateless. So my programming style is FOOP. Functional-OO-Procedural.</p>
<p>Really, it&#8217;s the future <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Peace<br />
-stephan</p>
<p>&#8211;<br />
Stephan Schmidt :: <a href="mailto:stephan@reposita.org">stephan@reposita.org</a><br />
Reposita Open Source &#8211; Monitor your software development<br />
<a href="http://www.reposita.org" rel="nofollow">http://www.reposita.org</a><br />
Blog at <a href="http://stephan.reposita.org" rel="nofollow">http://stephan.reposita.org</a> &#8211; No signal. No noise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-24</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Mon, 19 Nov 2007 14:05:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-24</guid>
		<description>To be honest I certainly don&#039;t think going to a repository is too procedural. I certainly don&#039;t want to make all the queries we use available on our aggregate roots, and why should I want to do it if the interface of the repository is part of the doman anyway?

We don&#039;t need to hide the existence of repositories/services because they are a part of the model.</description>
		<content:encoded><![CDATA[<p>To be honest I certainly don&#8217;t think going to a repository is too procedural. I certainly don&#8217;t want to make all the queries we use available on our aggregate roots, and why should I want to do it if the interface of the repository is part of the doman anyway?</p>
<p>We don&#8217;t need to hide the existence of repositories/services because they are a part of the model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio Kung</title>
		<link>http://fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-23</link>
		<dc:creator>Fabio Kung</dc:creator>
		<pubDate>Mon, 19 Nov 2007 13:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.fabiokung.com/2007/11/12/comments-to-gavin-king-about-ddd-and-repositories/#comment-23</guid>
		<description>&lt;blockquote&gt;A repository (or service which does some work and then calls the repository) seems like a better home.&lt;/blockquote&gt;
Sorry, but I disagree. &lt;code&gt;service.findOrders(client, date)&lt;/code&gt; is &lt;strong&gt;exactly&lt;/strong&gt; what I&#039;m avoiding here. It feels too much procedural.</description>
		<content:encoded><![CDATA[<blockquote><p>A repository (or service which does some work and then calls the repository) seems like a better home.</p></blockquote>
<p>Sorry, but I disagree. <code>service.findOrders(client, date)</code> is <strong>exactly</strong> what I&#8217;m avoiding here. It feels too much procedural.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
