<?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: Data Access With NHibernate</title>
	<atom:link href="http://davybrion.com/blog/2008/06/data-access-with-nhibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/</link>
	<description>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Fri, 12 Mar 2010 18:56:09 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: The Inquisitive Coder - Davy Brion&#8217;s Blog &#187; Blog Archive &#187; Transparent Query Batching Through Your Repository</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-10952</link>
		<dc:creator>The Inquisitive Coder - Davy Brion&#8217;s Blog &#187; Blog Archive &#187; Transparent Query Batching Through Your Repository</dc:creator>
		<pubDate>Wed, 01 Apr 2009 11:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-10952</guid>
		<description>[...] doesn&#8217;t want us to use it or where it wouldn&#8217;t make sense to use it) use the same Repository implementation. After the Future and FutureValue queries were added to NHibernate, i modified the implementation [...]</description>
		<content:encoded><![CDATA[<p>[...] doesn&#8217;t want us to use it or where it wouldn&#8217;t make sense to use it) use the same Repository implementation. After the Future and FutureValue queries were added to NHibernate, i modified the implementation [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-1833</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Sun, 07 Sep 2008 10:59:55 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-1833</guid>
		<description>@Steve

that&#039;s a good approach, i usually try to do the same, although my base repository isn&#039;t abstract.

In situations where you want to take advantage of NHibernate&#039;s MultiCriteria, it&#039;s hard not to leak the DetachedCriteria though. In those cases, i really can&#039;t be bothered with providing an abstraction that doesn&#039;t really provide a true benefit.</description>
		<content:encoded><![CDATA[<p>@Steve</p>
<p>that&#8217;s a good approach, i usually try to do the same, although my base repository isn&#8217;t abstract.</p>
<p>In situations where you want to take advantage of NHibernate&#8217;s MultiCriteria, it&#8217;s hard not to leak the DetachedCriteria though. In those cases, i really can&#8217;t be bothered with providing an abstraction that doesn&#8217;t really provide a true benefit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Bohlen</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-1820</link>
		<dc:creator>Steve Bohlen</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:50:23 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-1820</guid>
		<description>Whoops -- wordpress is actually removing my angle-brackets from my comments.  Imaging that was..

public class OrderRepository : Repository[Order] {...}

where the [ ]  are actually supposed to angle-brackets :)

Sorry for the multi-posts, took me a bit to realize what was going on (which is odd since my own blog is also using wordpress and I have the same issue(s)~!)</description>
		<content:encoded><![CDATA[<p>Whoops &#8212; wordpress is actually removing my angle-brackets from my comments.  Imaging that was..</p>
<p>public class OrderRepository : Repository[Order] {&#8230;}</p>
<p>where the [ ]  are actually supposed to angle-brackets <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Sorry for the multi-posts, took me a bit to realize what was going on (which is odd since my own blog is also using wordpress and I have the same issue(s)~!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Bohlen</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-1819</link>
		<dc:creator>Steve Bohlen</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:48:05 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-1819</guid>
		<description>Sorry, in that post the #3 item&#039;s class declaration was supposed to read...

public class OrderRepository : Repository {...}

(I forgot the &#039;of T&#039; part of the derivation statement~!)</description>
		<content:encoded><![CDATA[<p>Sorry, in that post the #3 item&#8217;s class declaration was supposed to read&#8230;</p>
<p>public class OrderRepository : Repository {&#8230;}</p>
<p>(I forgot the &#8216;of T&#8217; part of the derivation statement~!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Bohlen</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-1818</link>
		<dc:creator>Steve Bohlen</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-1818</guid>
		<description>Just as a suggestion to avoid the &#039;exposure&#039; of the NHib Criteria API outside your data-access-layer, I always recommend the following pattern...

1) create a Repository class much as you have outlined

2) we make ours abstract so that consumers MUST derive from it in order to use it as in...

3) public class OrderRepository : Repository {...}

4) within the OrderRepository class, we create methods like OrderRepository.GetOrdersSince(datetime orderDate) {...} that *internally* make use of the base Repository methods you suggest (Find, FindOne, etc. and can properly leverate the ICriteria API

5) callers of the data access methods then follow a pattern like...

OrderRespository orderRepository = new OrderRepository();
orderRepository.GetOrdersSince(&#039;1/1/2007&#039;);

...and consuming code NEVER explicity does...

Repository orderRepository = new Repository();

...and in fact cannot since Repository is intentionally abstract.  This way we get the goodness of the generics-enabled repository approch where the guts of the messy NHib-related code resides but the fact that NHib is in there somewhere isn&#039;t exposed to callers of the data-access-methods.</description>
		<content:encoded><![CDATA[<p>Just as a suggestion to avoid the &#8216;exposure&#8217; of the NHib Criteria API outside your data-access-layer, I always recommend the following pattern&#8230;</p>
<p>1) create a Repository class much as you have outlined</p>
<p>2) we make ours abstract so that consumers MUST derive from it in order to use it as in&#8230;</p>
<p>3) public class OrderRepository : Repository {&#8230;}</p>
<p>4) within the OrderRepository class, we create methods like OrderRepository.GetOrdersSince(datetime orderDate) {&#8230;} that *internally* make use of the base Repository methods you suggest (Find, FindOne, etc. and can properly leverate the ICriteria API</p>
<p>5) callers of the data access methods then follow a pattern like&#8230;</p>
<p>OrderRespository orderRepository = new OrderRepository();<br />
orderRepository.GetOrdersSince(&#8216;1/1/2007&#8242;);</p>
<p>&#8230;and consuming code NEVER explicity does&#8230;</p>
<p>Repository orderRepository = new Repository();</p>
<p>&#8230;and in fact cannot since Repository is intentionally abstract.  This way we get the goodness of the generics-enabled repository approch where the guts of the messy NHib-related code resides but the fact that NHib is in there somewhere isn&#8217;t exposed to callers of the data-access-methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Data Access With NHibernate - NHibernate blog - NH Forge</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-1541</link>
		<dc:creator>Data Access With NHibernate - NHibernate blog - NH Forge</dc:creator>
		<pubDate>Sun, 31 Aug 2008 15:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-1541</guid>
		<description>[...] NOTE: this post was originally published on June 23rd, 2008 [...]</description>
		<content:encoded><![CDATA[<p>[...] NOTE: this post was originally published on June 23rd, 2008 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Learn How to use NHibernate with the Summer of NHibernate Screencast Series - Readed By Wrocław NUG members - Wroc.NET</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-839</link>
		<dc:creator>Learn How to use NHibernate with the Summer of NHibernate Screencast Series - Readed By Wrocław NUG members - Wroc.NET</dc:creator>
		<pubDate>Tue, 22 Jul 2008 18:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-839</guid>
		<description>[...] is very flexible, but it&#039;s a little overwhelming (for me, at least) to get started. Davy has a good &quot;code-heavy&quot; walkthrough of the concepts. Some NHibernate write-ups assume too much, [...]</description>
		<content:encoded><![CDATA[<p>[...] is very flexible, but it&#39;s a little overwhelming (for me, at least) to get started. Davy has a good &quot;code-heavy&quot; walkthrough of the concepts. Some NHibernate write-ups assume too much, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stiiifff</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-694</link>
		<dc:creator>Stiiifff</dc:creator>
		<pubDate>Tue, 15 Jul 2008 12:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-694</guid>
		<description>Of course, they are the same (and both &#039;ok&#039; ;) lol) ... my second post was more about the choice of creating a strongly-typed repository for every entity type with finder methods (hence the &#039;Dao&#039; term), or use the generic one most of the time and derive when really necessary.

Don&#039;t get me wrong, I wouldn&#039;t choose an ORM over another just because of Linq support ... it&#039;s a matter of common sense. ;)</description>
		<content:encoded><![CDATA[<p>Of course, they are the same (and both &#8216;ok&#8217; <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  lol) &#8230; my second post was more about the choice of creating a strongly-typed repository for every entity type with finder methods (hence the &#8216;Dao&#8217; term), or use the generic one most of the time and derive when really necessary.</p>
<p>Don&#8217;t get me wrong, I wouldn&#8217;t choose an ORM over another just because of Linq support &#8230; it&#8217;s a matter of common sense. <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-693</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Tue, 15 Jul 2008 11:51:54 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-693</guid>
		<description>i don&#039;t really see the difference between Rhino.Common&#039;s generic repository leaking NHibernate specific details (such as Criteria) being &#039;ok&#039; and mine, especially since mine is just a simplified version of Rhino.Common&#039;s generic repository ;)

As for the business decision, i would much rather go with an ORM because of the qualities that it has instead of simply going with an ORM because another candidate doesn&#039;t support LINQ yet. LINQ is nice, but it is not that important. Even though LINQ is supposed to be a unified syntax and should in theory require less training, i don&#039;t really see that happening.  Each ORM and each LINQ provider will have its own little quirks.  The syntax might be the same, but the behavior might be somewhat different from provider to provider. The results should be the same, but a fast performing statement with one provider might be horrible with another.  Merely going for LINQ because of the unified querying syntax is a bit shortsighted ;)</description>
		<content:encoded><![CDATA[<p>i don&#8217;t really see the difference between Rhino.Common&#8217;s generic repository leaking NHibernate specific details (such as Criteria) being &#8216;ok&#8217; and mine, especially since mine is just a simplified version of Rhino.Common&#8217;s generic repository <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>As for the business decision, i would much rather go with an ORM because of the qualities that it has instead of simply going with an ORM because another candidate doesn&#8217;t support LINQ yet. LINQ is nice, but it is not that important. Even though LINQ is supposed to be a unified syntax and should in theory require less training, i don&#8217;t really see that happening.  Each ORM and each LINQ provider will have its own little quirks.  The syntax might be the same, but the behavior might be somewhat different from provider to provider. The results should be the same, but a fast performing statement with one provider might be horrible with another.  Merely going for LINQ because of the unified querying syntax is a bit shortsighted <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stiiifff</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-692</link>
		<dc:creator>Stiiifff</dc:creator>
		<pubDate>Tue, 15 Jul 2008 11:46:44 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-692</guid>
		<description>One more interesting info : you might want to check out the MSDN article of Ayende where he is describing &#039;Generic Specialization&#039; applied to Rhino.Commons&#039;s IRepository using Windsor container:
http://msdn2.microsoft.com/en-us/library/aa973811.aspx

This confirms the idea of &#039;write a strongly-typed repository only if you really need it&#039;.</description>
		<content:encoded><![CDATA[<p>One more interesting info : you might want to check out the MSDN article of Ayende where he is describing &#8216;Generic Specialization&#8217; applied to Rhino.Commons&#8217;s IRepository using Windsor container:<br />
<a href="http://msdn2.microsoft.com/en-us/library/aa973811.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/aa973811.aspx</a></p>
<p>This confirms the idea of &#8216;write a strongly-typed repository only if you really need it&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stiiifff</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-691</link>
		<dc:creator>Stiiifff</dc:creator>
		<pubDate>Tue, 15 Jul 2008 11:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-691</guid>
		<description>Davy, I agree that there is always a gap between theory and practice. I usually am a very down-to-earth guy ;o) lol

What we are talking about here is also a business decision, not just a technical one: if you write repositories strongly-coupled with NHibernate, it means the developers that will work on your app must know how to use NHibernate&#039;s HQL / Criteria API ... the time you gain by &#039;writing less code&#039;, you might loose it in training, debug, support. Also, as you say, you&#039;re not gonna change of ORM in the middle of a project, or between phases / releases ... so, you might want to choose an ORM that provides you with the safest future evolution path. And I think that today, starting a project with an ORM that doesn&#039;t support Linq is a little bit &#039;annoying&#039;, to say the least.

It also depends on the size of your project, you might not want to add an extra layer of abstraction for small projects ... but you would probably consider it on &#039;hundreds of entities &amp; thousands of business rules&#039; projects.

Concerning the ProductsRepository, sorry but I still call it a Dao. ;o) In essence, what you&#039;re doing is moving your stored procedures out of the database. Why do I need to give a name (=&gt; method of your strongly-typed repository) to every possible query I need in the application ?

In you don&#039;t mind your ORM to leak in your repository interface, a nice alternative is to have a generic repository that accept ORM-specific query criterion.
Your business components can then query directly on your generic repository (Ayende has a nice post called &#039;Querying is a business concern&#039;). If you want to re-use some of your queries, you might want to check the Specification pattern. The public API of your Business layer will be fine as long as it doesn&#039;t expose any ORM-specific type. This also implies that you will have to component-ize your business layer, which is a source of many other design questions. lol

The generic repository of Rhino.Commons is actually designed that way ... you can derive from it, but you should only do so if you really need it (very complex queries that you want to encapsulate) ... there is no point of creating a lot of methods for simple queries. For most cases, you can just use the generic repository and simply pass it your query criterion.</description>
		<content:encoded><![CDATA[<p>Davy, I agree that there is always a gap between theory and practice. I usually am a very down-to-earth guy ;o) lol</p>
<p>What we are talking about here is also a business decision, not just a technical one: if you write repositories strongly-coupled with NHibernate, it means the developers that will work on your app must know how to use NHibernate&#8217;s HQL / Criteria API &#8230; the time you gain by &#8216;writing less code&#8217;, you might loose it in training, debug, support. Also, as you say, you&#8217;re not gonna change of ORM in the middle of a project, or between phases / releases &#8230; so, you might want to choose an ORM that provides you with the safest future evolution path. And I think that today, starting a project with an ORM that doesn&#8217;t support Linq is a little bit &#8216;annoying&#8217;, to say the least.</p>
<p>It also depends on the size of your project, you might not want to add an extra layer of abstraction for small projects &#8230; but you would probably consider it on &#8216;hundreds of entities &amp; thousands of business rules&#8217; projects.</p>
<p>Concerning the ProductsRepository, sorry but I still call it a Dao. ;o) In essence, what you&#8217;re doing is moving your stored procedures out of the database. Why do I need to give a name (=&gt; method of your strongly-typed repository) to every possible query I need in the application ?</p>
<p>In you don&#8217;t mind your ORM to leak in your repository interface, a nice alternative is to have a generic repository that accept ORM-specific query criterion.<br />
Your business components can then query directly on your generic repository (Ayende has a nice post called &#8216;Querying is a business concern&#8217;). If you want to re-use some of your queries, you might want to check the Specification pattern. The public API of your Business layer will be fine as long as it doesn&#8217;t expose any ORM-specific type. This also implies that you will have to component-ize your business layer, which is a source of many other design questions. lol</p>
<p>The generic repository of Rhino.Commons is actually designed that way &#8230; you can derive from it, but you should only do so if you really need it (very complex queries that you want to encapsulate) &#8230; there is no point of creating a lot of methods for simple queries. For most cases, you can just use the generic repository and simply pass it your query criterion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-690</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Tue, 15 Jul 2008 11:00:39 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-690</guid>
		<description>i think they&#039;re targeting LINQ support for NH 2.1... not sure though, there are reasons why they can&#039;t easily provide a full implementation now.  Check the developers mailinglist for more details since it was brought up very recently

Regarding your earlier comment that repositories should provide a layer of abstraction between the business logic and the data access logic: in theory, you are correct. Practically speaking though, what&#039;s the point in providing another layer of abstraction for NHibernate&#039;s ICriteria? It&#039;s not like you&#039;re just gonna switch ORM&#039;s in the middle of a project. And since you&#039;d have to write more code to provide the abstraction you should think about the added value of that code. Is there really a benefit?  Wouldn&#039;t it be easier to just extend this repository class with specific versions for each entity that needs a repository?

for instance, you could easily provide a ProductsRepository class which extends this repository class. In the derived repository you could provide clean methods like FindProductByName or whatever that only take the required parameters, and the implementation of that method would only need to construct the criteria and pass it on the base repository implementation. Expose only the clean methods through an IProductsRepository interface, have your business code communicate only with the repository through that interface and voila, you&#039;re done without needing to do unnecessary work to achieve purely theoretical &#039;correctness&#039; :p</description>
		<content:encoded><![CDATA[<p>i think they&#8217;re targeting LINQ support for NH 2.1&#8230; not sure though, there are reasons why they can&#8217;t easily provide a full implementation now.  Check the developers mailinglist for more details since it was brought up very recently</p>
<p>Regarding your earlier comment that repositories should provide a layer of abstraction between the business logic and the data access logic: in theory, you are correct. Practically speaking though, what&#8217;s the point in providing another layer of abstraction for NHibernate&#8217;s ICriteria? It&#8217;s not like you&#8217;re just gonna switch ORM&#8217;s in the middle of a project. And since you&#8217;d have to write more code to provide the abstraction you should think about the added value of that code. Is there really a benefit?  Wouldn&#8217;t it be easier to just extend this repository class with specific versions for each entity that needs a repository?</p>
<p>for instance, you could easily provide a ProductsRepository class which extends this repository class. In the derived repository you could provide clean methods like FindProductByName or whatever that only take the required parameters, and the implementation of that method would only need to construct the criteria and pass it on the base repository implementation. Expose only the clean methods through an IProductsRepository interface, have your business code communicate only with the repository through that interface and voila, you&#8217;re done without needing to do unnecessary work to achieve purely theoretical &#8216;correctness&#8217; :p</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stiiifff</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-689</link>
		<dc:creator>Stiiifff</dc:creator>
		<pubDate>Tue, 15 Jul 2008 10:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-689</guid>
		<description>Yep, and that&#039;s too bad, Most of other non-MS ORM already have their provider for Linq. NHibernate is probably losing potential users to Linq2Sql / Entity Framework just because of that. This should the #1 priority of NHibernate contributors. ;o)</description>
		<content:encoded><![CDATA[<p>Yep, and that&#8217;s too bad, Most of other non-MS ORM already have their provider for Linq. NHibernate is probably losing potential users to Linq2Sql / Entity Framework just because of that. This should the #1 priority of NHibernate contributors. ;o)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-688</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Tue, 15 Jul 2008 09:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-688</guid>
		<description>Considering the fact that Linq for NHibernate is not complete yet, i&#039;d much rather stick to something that actually works :)</description>
		<content:encoded><![CDATA[<p>Considering the fact that Linq for NHibernate is not complete yet, i&#8217;d much rather stick to something that actually works <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stiiifff</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-686</link>
		<dc:creator>Stiiifff</dc:creator>
		<pubDate>Tue, 15 Jul 2008 07:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-686</guid>
		<description>Hello Davy,

NHibernate is leaking in your repository implementation ... a repository is supposed to give a layer of abstraction between your business logic and your data access logic. This is not the case here. What you call repository in this case is nothing more than a Dao.

I&#039;ve written some post about a generic Linq-friendly repository (inspired by several open source projects and blog posts):
http://blog.yoot.be/post/Domain-Driven-Design-with-Linq--ORM2c-Part-2.aspx

Who wants to use HQL or NHibernate criteria when Linq is around ? ;o)</description>
		<content:encoded><![CDATA[<p>Hello Davy,</p>
<p>NHibernate is leaking in your repository implementation &#8230; a repository is supposed to give a layer of abstraction between your business logic and your data access logic. This is not the case here. What you call repository in this case is nothing more than a Dao.</p>
<p>I&#8217;ve written some post about a generic Linq-friendly repository (inspired by several open source projects and blog posts):<br />
<a href="http://blog.yoot.be/post/Domain-Driven-Design-with-Linq--ORM2c-Part-2.aspx" rel="nofollow">http://blog.yoot.be/post/Domain-Driven-Design-with-Linq&#8211;ORM2c-Part-2.aspx</a></p>
<p>Who wants to use HQL or NHibernate criteria when Linq is around ? ;o)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-583</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Tue, 08 Jul 2008 21:00:09 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-583</guid>
		<description>Hi Mike,

http://www.hibernate.org/361.html#A7

According to that, DB2 UDB is indeed supported.  However, i would recommend that you definitely experiment with it to make sure it indeed does everything you need it to before you actually commit to using it in a real world project. Better safe than sorry :)</description>
		<content:encoded><![CDATA[<p>Hi Mike,</p>
<p><a href="http://www.hibernate.org/361.html#A7" rel="nofollow">http://www.hibernate.org/361.html#A7</a></p>
<p>According to that, DB2 UDB is indeed supported.  However, i would recommend that you definitely experiment with it to make sure it indeed does everything you need it to before you actually commit to using it in a real world project. Better safe than sorry <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Roosa</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-582</link>
		<dc:creator>Mike Roosa</dc:creator>
		<pubDate>Tue, 08 Jul 2008 20:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-582</guid>
		<description>Davy,
I&#039;m new to .net and data access layers.  I work for a company that has an IBM Universe Database.  This is an multivalue database that is quite a bit different than SQL Server.  The provide a dll for accessing the data but SQL queries, stored procedures don&#039;t work.  They have their own query language.  Can I use nhibernate with this or would I need to build this data access layer by hand?</description>
		<content:encoded><![CDATA[<p>Davy,<br />
I&#8217;m new to .net and data access layers.  I work for a company that has an IBM Universe Database.  This is an multivalue database that is quite a bit different than SQL Server.  The provide a dll for accessing the data but SQL queries, stored procedures don&#8217;t work.  They have their own query language.  Can I use nhibernate with this or would I need to build this data access layer by hand?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://davybrion.com/blog/2008/06/data-access-with-nhibernate/comment-page-1/#comment-473</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 24 Jun 2008 00:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=151#comment-473</guid>
		<description>Thanks for this! This is a great summary of the fundamental queries you need to work with NHibernate. I only have very basic experience with NHibernate, and this has really helped clarify things for me.
Cheers,
David</description>
		<content:encoded><![CDATA[<p>Thanks for this! This is a great summary of the fundamental queries you need to work with NHibernate. I only have very basic experience with NHibernate, and this has really helped clarify things for me.<br />
Cheers,<br />
David</p>
]]></content:encoded>
	</item>
</channel>
</rss>
