<?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:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Implementing the Repository and Finder patterns</title>
	<atom:link href="http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/feed/" rel="self" type="application/rss+xml" />
	<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/</link>
	<description>Just another developer on a rant</description>
	<lastBuildDate>Wed, 28 Oct 2009 03:20:02 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Serge Duval</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-168</link>
		<dc:creator>Serge Duval</dc:creator>
		<pubDate>Mon, 27 Jul 2009 04:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-168</guid>
		<description>UML diagrams - use them.</description>
		<content:encoded><![CDATA[<p>UML diagrams &#8211; use them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nam</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-147</link>
		<dc:creator>Nam</dc:creator>
		<pubDate>Tue, 09 Jun 2009 14:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-147</guid>
		<description>Nice article. It keeps me out of writing too many repositories for different ORMs, or even differrent databases.</description>
		<content:encoded><![CDATA[<p>Nice article. It keeps me out of writing too many repositories for different ORMs, or even differrent databases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-69</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 17 Feb 2009 18:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-69</guid>
		<description>In the example above (and possibly forced into other persistence implementations due to the design), isn&#039;t Query() returning all the records of the requested type?  If, for example, I had a forum application with 50,000 post records, then if I understand this correctly (not saying I do), then wouldn&#039;t each and every find require loading all 50,000 records from the database so I can parse through them with the Find* methods?</description>
		<content:encoded><![CDATA[<p>In the example above (and possibly forced into other persistence implementations due to the design), isn&#8217;t Query() returning all the records of the requested type?  If, for example, I had a forum application with 50,000 post records, then if I understand this correctly (not saying I do), then wouldn&#8217;t each and every find require loading all 50,000 records from the database so I can parse through them with the Find* methods?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Campbell</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-63</link>
		<dc:creator>Bill Campbell</dc:creator>
		<pubDate>Sat, 31 Jan 2009 13:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-63</guid>
		<description>Excellent articles! I have been reading through your series here and like others would sure love to get my hands on a sample. I think it would pull together alot of the things you&#039;ve been discussing.

thanks!
Bill</description>
		<content:encoded><![CDATA[<p>Excellent articles! I have been reading through your series here and like others would sure love to get my hands on a sample. I think it would pull together alot of the things you&#8217;ve been discussing.</p>
<p>thanks!<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ticker</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-39</link>
		<dc:creator>Ticker</dc:creator>
		<pubDate>Wed, 10 Dec 2008 21:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-39</guid>
		<description>Great Article, Would you be able to post a sample application ?</description>
		<content:encoded><![CDATA[<p>Great Article, Would you be able to post a sample application ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-38</link>
		<dc:creator>Travis</dc:creator>
		<pubDate>Wed, 03 Dec 2008 22:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-38</guid>
		<description>That does, and I have since started to implement Finders, as this has become a problem: &quot;become large and god-like&quot;.  Thank you again.</description>
		<content:encoded><![CDATA[<p>That does, and I have since started to implement Finders, as this has become a problem: &#8220;become large and god-like&#8221;.  Thank you again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: russelleast</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-31</link>
		<dc:creator>russelleast</dc:creator>
		<pubDate>Sat, 22 Nov 2008 21:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-31</guid>
		<description>Travis, many reasons for not bloating your repository with find methods. The first reason is that your repository interface will grow and your class will become large and god-like. Another more valid reason, is seperation of concern. I can encapulate all my logic for finding an &quot;entity&quot; into a &quot;finder&quot; for that entity.

As you have read this post, you should understand the role of the &quot;IpersistenceRepository&quot;. When you create a concrete implemation of this interface, it will be using a technology like nhibernate, db4o, ado.net etc etc. Its the same for the finders, the concrete finders will be using a technology to perform the query logic (detachedCriteria, Linq for Objects, native queries in db4o etc etc).  Your application should be ignorant to technologies otherwise your application is coupled to a technology that may give you some pain in the future when you want to upgrade or replace it. My point being that my ApplicationUserRepository only knows about the interface for the finder, not the technology that used to perform the finding. I used an Inversion of Control container to inject my dependancies at runtime. So if i want to upgrade or replace my ORM technology i could create new finder objects and switch them in my IoC configuration. This is something that i have had to do.

Another and final reason that i am going to give now is: Fluent interfaces. if you put your find method in your repository, how are you going to do method chaining? you would have to return your repository as the return type for your find methods in order to find by another method. The repository will have methods like &quot;Save&quot;, this not going to give a nice fluent-interface. I have a post in draft at the moment this expands this post by implementing a fluent interface on the finders that covers sorting, mulitple find methods chained together and pagination.

To conclude, putting specific find methods into your repository is a bad design choice.

Hope this helps ;-)</description>
		<content:encoded><![CDATA[<p>Travis, many reasons for not bloating your repository with find methods. The first reason is that your repository interface will grow and your class will become large and god-like. Another more valid reason, is seperation of concern. I can encapulate all my logic for finding an &#8220;entity&#8221; into a &#8220;finder&#8221; for that entity.</p>
<p>As you have read this post, you should understand the role of the &#8220;IpersistenceRepository&#8221;. When you create a concrete implemation of this interface, it will be using a technology like nhibernate, db4o, ado.net etc etc. Its the same for the finders, the concrete finders will be using a technology to perform the query logic (detachedCriteria, Linq for Objects, native queries in db4o etc etc).  Your application should be ignorant to technologies otherwise your application is coupled to a technology that may give you some pain in the future when you want to upgrade or replace it. My point being that my ApplicationUserRepository only knows about the interface for the finder, not the technology that used to perform the finding. I used an Inversion of Control container to inject my dependancies at runtime. So if i want to upgrade or replace my ORM technology i could create new finder objects and switch them in my IoC configuration. This is something that i have had to do.</p>
<p>Another and final reason that i am going to give now is: Fluent interfaces. if you put your find method in your repository, how are you going to do method chaining? you would have to return your repository as the return type for your find methods in order to find by another method. The repository will have methods like &#8220;Save&#8221;, this not going to give a nice fluent-interface. I have a post in draft at the moment this expands this post by implementing a fluent interface on the finders that covers sorting, mulitple find methods chained together and pagination.</p>
<p>To conclude, putting specific find methods into your repository is a bad design choice.</p>
<p>Hope this helps <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-30</link>
		<dc:creator>Travis</dc:creator>
		<pubDate>Fri, 21 Nov 2008 22:01:49 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-30</guid>
		<description>What is the point of implementing the finder class vs just putting those FindBy* methods in the Repository implementation?</description>
		<content:encoded><![CDATA[<p>What is the point of implementing the finder class vs just putting those FindBy* methods in the Repository implementation?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-26</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Thu, 06 Nov 2008 11:22:51 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-26</guid>
		<description>Nice article, how does it go with the sample application?</description>
		<content:encoded><![CDATA[<p>Nice article, how does it go with the sample application?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://russelleast.wordpress.com/2008/09/20/implementing-the-repository-and-finder-patterns/#comment-25</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Thu, 06 Nov 2008 11:00:48 +0000</pubDate>
		<guid isPermaLink="false">http://russelleast.wordpress.com/?p=94#comment-25</guid>
		<description>Hi Russel, Very interesting. Do you have an example for downloading as you mention ?
Thanks !</description>
		<content:encoded><![CDATA[<p>Hi Russel, Very interesting. Do you have an example for downloading as you mention ?<br />
Thanks !</p>
]]></content:encoded>
	</item>
</channel>
</rss>
