<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-5996062652829415230.post4867085207481673158..comments</id><updated>2009-07-07T08:57:39.888-04:00</updated><title type='text'>Comments on The Untitled Blog: An Opinion on Repository</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.stevehorn.cc/feeds/4867085207481673158/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default'/><link rel='alternate' type='text/html' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html'/><author><name>Steve Horn</name><uri>http://www.blogger.com/profile/11799829988971859359</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5996062652829415230.post-6967347159318779381</id><published>2009-07-07T07:35:51.406-04:00</published><updated>2009-07-07T07:35:51.406-04:00</updated><title type='text'>You're not the first person to say that. :)

http:...</title><content type='html'>You&amp;#39;re not the first person to say that. :)&lt;br /&gt;&lt;br /&gt;http://ayende.com/Blog/archive/2009/04/17/repository-is-the-new-singleton.aspx&lt;br /&gt;&lt;br /&gt;I still like the repository, but maybe I&amp;#39;m just used to it.  My repository class mostly just calls into NHibernate&amp;#39;s ISession, but it&amp;#39;s allowed me to abstract some stuff away (like setting FlushMode on the session, hiding NHibernate&amp;#39;s query stuff inside methods with nice names, etc.).&lt;br /&gt;&lt;br /&gt;It&amp;#39;s not like it&amp;#39;s a lot more work to have a repository in there.  It&amp;#39;s one file that I wrote one time and I pretty much never change it, but it allows me the flexibility to override the default behavior if I ever need to.&lt;br /&gt;&lt;br /&gt;Will I ever need to?  I might not.  But I think having the extensibility point is worth it especially since it didn&amp;#39;t really cost me anything to put it in.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default/6967347159318779381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default/6967347159318779381'/><link rel='alternate' type='text/html' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html?showComment=1246966551406#c6967347159318779381' title=''/><author><name>Jon Kruger</name><uri>http://www.blogger.com/profile/17967382331944684749</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html' ref='tag:blogger.com,1999:blog-5996062652829415230.post-4867085207481673158' source='http://www.blogger.com/feeds/5996062652829415230/posts/default/4867085207481673158' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5996062652829415230.post-9083808931348068479</id><published>2009-07-06T22:34:36.404-04:00</published><updated>2009-07-06T22:34:36.404-04:00</updated><title type='text'>@Jon

So why not just have your service layer just...</title><content type='html'>@Jon&lt;br /&gt;&lt;br /&gt;So why not just have your service layer just take a dependency on NHibernate&amp;#39;s ISession, or Linq To SQL&amp;#39;s DataContext?  It doesn&amp;#39;t seem like the repository really buys you anything...other than adding a layer of indirection so swapping out ORM implementations can be achieved.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default/9083808931348068479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default/9083808931348068479'/><link rel='alternate' type='text/html' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html?showComment=1246934076404#c9083808931348068479' title=''/><author><name>Steve Horn</name><uri>http://www.blogger.com/profile/11799829988971859359</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09154138260003946301'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html' ref='tag:blogger.com,1999:blog-5996062652829415230.post-4867085207481673158' source='http://www.blogger.com/feeds/5996062652829415230/posts/default/4867085207481673158' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5996062652829415230.post-4196477654942439318</id><published>2009-07-06T11:05:14.365-04:00</published><updated>2009-07-06T11:05:14.365-04:00</updated><title type='text'>The way I see it, the single responsibility of the...</title><content type='html'>The way I see it, the single responsibility of the Repository is to perform operations on a data store (CRUD operations using an ORM, calling stored procs, etc.)  The repository itself should not have any business logic in it -- that goes in a domain service.&lt;br /&gt;&lt;br /&gt;So in your example, I would change IOrderRepository to something like IOrderService, IGetOrderService, or IGetPendingOrdersService (depending on how granualar you want to get with it).  The domain service would not derive from IBaseRepository&amp;lt;T&amp;gt;, but would take an IBaseRepository&amp;lt;T&amp;gt; in as a constructor parameter so that it could perform the query.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default/4196477654942439318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5996062652829415230/4867085207481673158/comments/default/4196477654942439318'/><link rel='alternate' type='text/html' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html?showComment=1246892714365#c4196477654942439318' title=''/><author><name>Jon Kruger</name><uri>http://www.blogger.com/profile/17967382331944684749</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.stevehorn.cc/2009/07/opinion-on-repository.html' ref='tag:blogger.com,1999:blog-5996062652829415230.post-4867085207481673158' source='http://www.blogger.com/feeds/5996062652829415230/posts/default/4867085207481673158' type='text/html'/></entry></feed>