<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx</link><description>Some people like to automatically generate their database tier. Personally, I had enough bad experiences with ORM tools that I try to avoid them. After all, data tier code can be knocked out pretty quickly and it's always nice to know you didn't take</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5600192</link><pubDate>Sun, 13 Jan 2008 22:23:25 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5600192</guid><dc:creator>Mike Gale</dc:creator><author>Mike Gale</author><description>&lt;p&gt;What fascinating responses. &amp;nbsp;(A response often tells you more about the person who wrote it than about the article they comment on!!)&lt;/p&gt;
&lt;p&gt;I'd appreciate a follow up on the impact of this approach (maybe a couple of ORM's thrown in too) on real projects.&lt;/p&gt;
&lt;p&gt;(It would be great to see issues like code readability, time to get back up to speed (after a break), making changes, LOC and time taken, addressed. &amp;nbsp;But I know, it's nearly always impossible.)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5600192" width="1" height="1"&gt;</description></item><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5587890</link><pubDate>Fri, 11 Jan 2008 12:26:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5587890</guid><dc:creator>Jesse Ezell</dc:creator><author>Jesse Ezell</author><description>&lt;p&gt;JV, &lt;/p&gt;
&lt;p&gt;I&amp;#39;ve seen far too many bad design decisions made because something is theoretically &amp;quot;less work.&amp;quot; That is a really hazy term. Less code does not always equal less work. I&amp;#39;ve used ORM tools and I&amp;#39;ve used the approach described here, and my experience in taking projects through their full life cycle tells a different story.&lt;/p&gt;&lt;p&gt;However, this post was not to discuss whether or not to use ORM. If you&amp;#39;ve had success with ORM on the type of projects you are involved with, more power to you. There are situations where ORM makes sense.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5587890" width="1" height="1"&gt;</description></item><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5587804</link><pubDate>Fri, 11 Jan 2008 12:11:51 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5587804</guid><dc:creator>Jesse Ezell</dc:creator><author>Jesse Ezell</author><description>&lt;p&gt;Ramon,&lt;/p&gt;
&lt;p&gt;A. Maybe you could clarify what you are trying to say here and state what is bad, instead of asking a question in the form of a sentence fragment. &lt;br /&gt; &lt;/p&gt;
&lt;p&gt;B. You can easily provide multiple overloads for a method, one taking only required parameters and one with required and optional parameters. This is just a simple sample.&lt;/p&gt;
&lt;p&gt;C. Your question tells me you haven&amp;#39;t aren&amp;#39;t familiar with generics. default(T) used with a reference type returns null, so you would check for empty as you normally would. (http://msdn2.microsoft.com/en-us/library/xwth0h0d(VS.80).aspx)&lt;br /&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5587804" width="1" height="1"&gt;</description></item><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5587321</link><pubDate>Fri, 11 Jan 2008 10:22:14 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5587321</guid><dc:creator>JV</dc:creator><author>JV</author><description>&lt;p&gt;An ORM is much more then just a database layer imao. Besides that I totally agree with Ramon. The DAl you have created isn't very flexible. It will actually require more work then when you would be using an ORM. And let's be fair, with LINQ To SQL and the upcoming Entity Framework ORM in .NET was never this easy...&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5587321" width="1" height="1"&gt;</description></item><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5586811</link><pubDate>Fri, 11 Jan 2008 08:35:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5586811</guid><dc:creator>Ramon Smits</dc:creator><author>Ramon Smits</author><description>&lt;p&gt;You really should take a look at projects like NHibernate because I see a couple of bad practices in your examples.&lt;/p&gt;
&lt;p&gt;A. Using a fixed result stored procedure to initialize a custom type?&lt;/p&gt;
&lt;p&gt;B. Your &amp;quot;CreateCustomer&amp;quot; method is not flexible. What about optional fields? This could be a constructor for the Customer class.&lt;/p&gt;
&lt;p&gt;C. Returning a default Customer instance when NO record is found in the database? How to check if data is returned then?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5586811" width="1" height="1"&gt;</description></item><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5586383</link><pubDate>Fri, 11 Jan 2008 07:16:21 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5586383</guid><dc:creator>Jesse Ezell</dc:creator><author>Jesse Ezell</author><description>&lt;p&gt;Regardless of your opinion on the issue, this naming pattern is pretty commonly used and accepted.&lt;/p&gt;
&lt;p&gt;Just ask Microsoft:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/microsoft.commerceserver.marketing.customermanager.aspx"&gt;msdn2.microsoft.com/.../microsoft.commerceserver.marketing.customermanager.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;or BEA:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://edocs.beasys.co.jp/weblogic/wlcs20doc/javadoc/comp/theory/smart/ebusiness/customer/CustomerManager.html"&gt;edocs.beasys.co.jp/.../CustomerManager.html&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5586383" width="1" height="1"&gt;</description></item><item><title>re: Designing a Generic Database Layer</title><link>http://weblogs.asp.net/jezell/archive/2008/01/10/designing-a-generic-database-layer.aspx#5586303</link><pubDate>Fri, 11 Jan 2008 07:02:24 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5586303</guid><dc:creator>foobar</dc:creator><author>foobar</author><description>&lt;p&gt;I'd throttle you and kick your butt to the curb if you ever worked for me and made a class called &amp;quot;CustomerManager&amp;quot;. &amp;nbsp;Could you make a more generic name for a class?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5586303" width="1" height="1"&gt;</description></item></channel></rss>