<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">
<channel>
	<title>Comments for appsCanadian.ca</title>
	
	<link>http://www.appscanadian.ca</link>
	<description>The "Teach Yourself Software Development" Experiment</description>
	<lastBuildDate>Wed, 10 Jun 2009 04:18:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/appsCanadian/comments" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="appscanadian/comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by John Farrell</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1356</link>
		<dc:creator>John Farrell</dc:creator>
		<pubDate>Wed, 10 Jun 2009 04:18:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1356</guid>
		<description>@simonTwebi, I'm not going to call you out with specifics here but your comment really sounds like your problems are from shoddy code and not an ORM mapper in general.

I've used two different ORM mappers in sites with thousands of queries executing every second and both ORMs had almost no noticeable effect on performance.

Take a look at this post about the Subsonic ORM:
http://blog.wekeroad.com/blog/subsonic-scaling/

"I’ve just pumped a million orders (and items - 2 million records total) into my SQLExpress Northwind database and it took just about 22 minutes (which is about 1500 records a second):"

Here's a link to a performance test of NHibernate:
http://www.iamnotmyself.com/2008/07/02/NHibernateTestingThePerformanceUrbanLegend.aspx

1000 inserts via Stored Procedure was only 175ms faster than NHibernate.  That means that NHibernate added .17 ms to the overhead of inserting a record.

So when you say "several hundred-fold improvement in performance, on average." for adding items into the database the problem likely due to a specific problem with your code.

Overall, popular ORM packages have a negligible effect on performance and its unfair to say all ORM performance is inadequate based on these numbers.</description>
		<content:encoded><![CDATA[<p>@simonTwebi, I&#8217;m not going to call you out with specifics here but your comment really sounds like your problems are from shoddy code and not an ORM mapper in general.</p>
<p>I&#8217;ve used two different ORM mappers in sites with thousands of queries executing every second and both ORMs had almost no noticeable effect on performance.</p>
<p>Take a look at this post about the Subsonic ORM:<br />
<a href="http://blog.wekeroad.com/blog/subsonic-scaling/" rel="nofollow">http://blog.wekeroad.com/blog/subsonic-scaling/</a></p>
<p>&#8220;I’ve just pumped a million orders (and items &#8211; 2 million records total) into my SQLExpress Northwind database and it took just about 22 minutes (which is about 1500 records a second):&#8221;</p>
<p>Here&#8217;s a link to a performance test of NHibernate:<br />
<a href="http://www.iamnotmyself.com/2008/07/02/NHibernateTestingThePerformanceUrbanLegend.aspx" rel="nofollow">http://www.iamnotmyself.com/2008/07/02/NHibernateTestingThePerformanceUrbanLegend.aspx</a></p>
<p>1000 inserts via Stored Procedure was only 175ms faster than NHibernate.  That means that NHibernate added .17 ms to the overhead of inserting a record.</p>
<p>So when you say &#8220;several hundred-fold improvement in performance, on average.&#8221; for adding items into the database the problem likely due to a specific problem with your code.</p>
<p>Overall, popular ORM packages have a negligible effect on performance and its unfair to say all ORM performance is inadequate based on these numbers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by JS</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1339</link>
		<dc:creator>JS</dc:creator>
		<pubDate>Mon, 08 Jun 2009 06:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1339</guid>
		<description>Jesse,

I'd encourage you to write at least one or two database applications before you start using an ORM.  While it can be a bit more tedious writing the queries by hand and debugging them, it is a worthwhile learning experience.  Once the learning is done and you're just repeating the same busywork you've already done a number of times before, then the ORM makes a lot more sense.</description>
		<content:encoded><![CDATA[<p>Jesse,</p>
<p>I&#8217;d encourage you to write at least one or two database applications before you start using an ORM.  While it can be a bit more tedious writing the queries by hand and debugging them, it is a worthwhile learning experience.  Once the learning is done and you&#8217;re just repeating the same busywork you&#8217;ve already done a number of times before, then the ORM makes a lot more sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by SimonTewbi</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1336</link>
		<dc:creator>SimonTewbi</dc:creator>
		<pubDate>Mon, 08 Jun 2009 01:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1336</guid>
		<description>@John Farrell: 

I've become sceptical of ORMs and abstraction layers.  Great in theory but I've not yet seen an implementation that doesn't suck either for maintenance coders or for performance, or both. 

I used to be big on following principles when coding.  After several years of contracting, working on existing code bases, I'm now in favour of practicality.  I rate everything now based on the two criteria I mentioned above: 

1) Is it easy to maintain?
2) Is the performance adequate?

Almost all the code I've come across fails one or both of these two criteria.

The code-base I'm working on at the moment is a case in point.  I need to change the way the data is stored in the database.  First step, reverse engineering the existing code to find out how it saves the data.  10 - 12 nested methods between clicking a button on the UI and something happening in the database (not to mention side calls to read properties or get specific data).  And slow as a dog.  All the business logic in the middleware layer.  Great idea but it involves 3 database writes and 4 reads to add an item to an order.  Maximum of 99 items can be added at a time.  I make that up to 693 database accesses to perform a single operation (adding a bunch of items to an order).  It took two days to rewrite the code to perform a single database update for all items.  Still using a data access layer but moving the business logic to a stored procedure in the database.  No good from a purist's point of view but all the business logic is in one place (the stored proc) and we got a several hundred-fold improvement in performance, on average.</description>
		<content:encoded><![CDATA[<p>@John Farrell: </p>
<p>I&#8217;ve become sceptical of ORMs and abstraction layers.  Great in theory but I&#8217;ve not yet seen an implementation that doesn&#8217;t suck either for maintenance coders or for performance, or both. </p>
<p>I used to be big on following principles when coding.  After several years of contracting, working on existing code bases, I&#8217;m now in favour of practicality.  I rate everything now based on the two criteria I mentioned above: </p>
<p>1) Is it easy to maintain?<br />
2) Is the performance adequate?</p>
<p>Almost all the code I&#8217;ve come across fails one or both of these two criteria.</p>
<p>The code-base I&#8217;m working on at the moment is a case in point.  I need to change the way the data is stored in the database.  First step, reverse engineering the existing code to find out how it saves the data.  10 &#8211; 12 nested methods between clicking a button on the UI and something happening in the database (not to mention side calls to read properties or get specific data).  And slow as a dog.  All the business logic in the middleware layer.  Great idea but it involves 3 database writes and 4 reads to add an item to an order.  Maximum of 99 items can be added at a time.  I make that up to 693 database accesses to perform a single operation (adding a bunch of items to an order).  It took two days to rewrite the code to perform a single database update for all items.  Still using a data access layer but moving the business logic to a stored procedure in the database.  No good from a purist&#8217;s point of view but all the business logic is in one place (the stored proc) and we got a several hundred-fold improvement in performance, on average.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by Jesse Hartwick</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1334</link>
		<dc:creator>Jesse Hartwick</dc:creator>
		<pubDate>Sun, 07 Jun 2009 23:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1334</guid>
		<description>@John Farrell:
I'm not specifically using Access/Jet because *I* know it. I'm using it partially because people at work know it (in case you haven't read my other posts, I do consulting on a legacy, partially cobol-based system, with people who may or may not be comfortable with other systems) and I'm not planning on being at this job forever. I'm doing this project largely as a springboard to leave, actually.

Other than that, you're mostly right. I didn't look at Firebird because it was simply off my radar, but I did take a look at SqlLite. I didn't actually use it, but from what I read on their site, it just didn't seem suitable:

"Situations Where Another RDBMS May Work Better

Client/Server Applications
&lt;snip&gt;
A good rule of thumb is that you should avoid using SQLite in situations where the same database will be accessed simultaneously from many computers over a network filesystem.

High Concurrency

SQLite uses reader/writer locks on the entire database file. That means if any process is reading from any part of the database, all other processes are prevented from writing any other part of the database. Similarly, if any one process is writing to the database, all other processes are prevented from reading any other part of the database."

Source: http://www.sqlite.org/whentouse.html

That said, after all the feedback I've received from this post, I'm definitely going to take a closer look at nHibernate. I also like SQL Server Compact, but I haven't looked close enough at it to see if it's suitable.</description>
		<content:encoded><![CDATA[<p>@John Farrell:<br />
I&#8217;m not specifically using Access/Jet because *I* know it. I&#8217;m using it partially because people at work know it (in case you haven&#8217;t read my other posts, I do consulting on a legacy, partially cobol-based system, with people who may or may not be comfortable with other systems) and I&#8217;m not planning on being at this job forever. I&#8217;m doing this project largely as a springboard to leave, actually.</p>
<p>Other than that, you&#8217;re mostly right. I didn&#8217;t look at Firebird because it was simply off my radar, but I did take a look at SqlLite. I didn&#8217;t actually use it, but from what I read on their site, it just didn&#8217;t seem suitable:</p>
<p>&#8220;Situations Where Another RDBMS May Work Better</p>
<p>Client/Server Applications<br />
<snip><br />
A good rule of thumb is that you should avoid using SQLite in situations where the same database will be accessed simultaneously from many computers over a network filesystem.</p>
<p>High Concurrency</p>
<p>SQLite uses reader/writer locks on the entire database file. That means if any process is reading from any part of the database, all other processes are prevented from writing any other part of the database. Similarly, if any one process is writing to the database, all other processes are prevented from reading any other part of the database.&#8221;</p>
<p>Source: <a href="http://www.sqlite.org/whentouse.html" rel="nofollow">http://www.sqlite.org/whentouse.html</a></p>
<p>That said, after all the feedback I&#8217;ve received from this post, I&#8217;m definitely going to take a closer look at nHibernate. I also like SQL Server Compact, but I haven&#8217;t looked close enough at it to see if it&#8217;s suitable.</snip></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by John Farrell</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1333</link>
		<dc:creator>John Farrell</dc:creator>
		<pubDate>Sun, 07 Jun 2009 23:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1333</guid>
		<description>No, this seems like "I have no hammer, therefore I'll create my own".

Not using an ORM mapper, or getting to learn one, is going to waste your time and prevent you from focusing on leaning C#.  Without an ORM mapper your going to have to write every single query that accesses your database by hand and then debug those queries when you inevitably make a typo.

The real "everything is a hammer" problem is probably your choice to use Access as a backend DB "because you know it".  This is what the saying is used for.  Because you know Access every persistence problem your have your going to try and fix with Access.

Try branching out into something like Firebird or SqlLite instead of what you know if you really can't get connected to your company's sql servers.</description>
		<content:encoded><![CDATA[<p>No, this seems like &#8220;I have no hammer, therefore I&#8217;ll create my own&#8221;.</p>
<p>Not using an ORM mapper, or getting to learn one, is going to waste your time and prevent you from focusing on leaning C#.  Without an ORM mapper your going to have to write every single query that accesses your database by hand and then debug those queries when you inevitably make a typo.</p>
<p>The real &#8220;everything is a hammer&#8221; problem is probably your choice to use Access as a backend DB &#8220;because you know it&#8221;.  This is what the saying is used for.  Because you know Access every persistence problem your have your going to try and fix with Access.</p>
<p>Try branching out into something like Firebird or SqlLite instead of what you know if you really can&#8217;t get connected to your company&#8217;s sql servers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by Joshua Volz</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1332</link>
		<dc:creator>Joshua Volz</dc:creator>
		<pubDate>Sun, 07 Jun 2009 22:38:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1332</guid>
		<description>I agree the 2nd option is better.  I like to make an adapter class that implements database specific functionality (for .NET, provider specific stuff), and then have the database layer classes call the adapter methods.  Also, you should look into auto-generating the database layer, either with one of the OR/Ms listed above or just roll your own that meets your needs.  You can go way overboard with OR/M for small projects.  It should be automatic and easy to re-run after you make a database change.  I personally like to use a scripting language for this purpose, but there is some value in using the main language of your project.</description>
		<content:encoded><![CDATA[<p>I agree the 2nd option is better.  I like to make an adapter class that implements database specific functionality (for .NET, provider specific stuff), and then have the database layer classes call the adapter methods.  Also, you should look into auto-generating the database layer, either with one of the OR/Ms listed above or just roll your own that meets your needs.  You can go way overboard with OR/M for small projects.  It should be automatic and easy to re-run after you make a database change.  I personally like to use a scripting language for this purpose, but there is some value in using the main language of your project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If You Have A Hammer, It’s Not Always Wrong To Use It by JS</title>
		<link>http://www.appscanadian.ca/archives/if-you-have-a-hammer-its-not-always-wrong-to-use-it/comment-page-1/#comment-1326</link>
		<dc:creator>JS</dc:creator>
		<pubDate>Sun, 07 Jun 2009 10:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=20#comment-1326</guid>
		<description>Option #2 is better because it is a fairly well-known design pattern - "Data Access Objects".  http://en.wikipedia.org/wiki/Data_Access_Object

Instead of putting the common database lookup routines in the base class, treat them as a separate "Database abstraction layer".  This way, you won't have to modify any of the DAO classes if you ever change out your database.  You just write a new Database abstraction layer with the same API as the old one and you're done.

http://en.wikipedia.org/wiki/Database_abstraction_layer
  
Yes, this splits your application classes into 3 layers that sit on top of the database, but the extra flexibility and modularity are worth it.</description>
		<content:encoded><![CDATA[<p>Option #2 is better because it is a fairly well-known design pattern &#8211; &#8220;Data Access Objects&#8221;.  <a href="http://en.wikipedia.org/wiki/Data_Access_Object" rel="nofollow">http://en.wikipedia.org/wiki/Data_Access_Object</a></p>
<p>Instead of putting the common database lookup routines in the base class, treat them as a separate &#8220;Database abstraction layer&#8221;.  This way, you won&#8217;t have to modify any of the DAO classes if you ever change out your database.  You just write a new Database abstraction layer with the same API as the old one and you&#8217;re done.</p>
<p><a href="http://en.wikipedia.org/wiki/Database_abstraction_layer" rel="nofollow">http://en.wikipedia.org/wiki/Database_abstraction_layer</a></p>
<p>Yes, this splits your application classes into 3 layers that sit on top of the database, but the extra flexibility and modularity are worth it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting Off Right With Version Control by Jesse Hartwick</title>
		<link>http://www.appscanadian.ca/archives/starting-off-right-with-version-control/comment-page-1/#comment-1317</link>
		<dc:creator>Jesse Hartwick</dc:creator>
		<pubDate>Fri, 05 Jun 2009 03:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=17#comment-1317</guid>
		<description>Hi Ryan,

This looks like an interesting site, but I think I'll be alright keeping my repository on my laptop for now since it's the only place I do any development work (for now, at least).

As the project gets bigger, I'll probably be posting more and more code looking for feedback. Perhaps when that time comes I'll look at hosting the repository so my readership (both of you!) can easily access the whole project.</description>
		<content:encoded><![CDATA[<p>Hi Ryan,</p>
<p>This looks like an interesting site, but I think I&#8217;ll be alright keeping my repository on my laptop for now since it&#8217;s the only place I do any development work (for now, at least).</p>
<p>As the project gets bigger, I&#8217;ll probably be posting more and more code looking for feedback. Perhaps when that time comes I&#8217;ll look at hosting the repository so my readership (both of you!) can easily access the whole project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting Off Right With Version Control by Ryan Ische</title>
		<link>http://www.appscanadian.ca/archives/starting-off-right-with-version-control/comment-page-1/#comment-1316</link>
		<dc:creator>Ryan Ische</dc:creator>
		<pubDate>Fri, 05 Jun 2009 03:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=17#comment-1316</guid>
		<description>You may want to check out http://unfuddle.com/.  I use it for my personal projects.  It's especially nice if you have multiple PCs that you work from.</description>
		<content:encoded><![CDATA[<p>You may want to check out <a href="http://unfuddle.com/" rel="nofollow">http://unfuddle.com/</a>.  I use it for my personal projects.  It&#8217;s especially nice if you have multiple PCs that you work from.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Project by Ryan Ische</title>
		<link>http://www.appscanadian.ca/archives/the-project/comment-page-1/#comment-1096</link>
		<dc:creator>Ryan Ische</dc:creator>
		<pubDate>Wed, 27 May 2009 11:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.appscanadian.ca/?p=16#comment-1096</guid>
		<description>Good to hear from you again, Jesse.  Sounds like a cool project!</description>
		<content:encoded><![CDATA[<p>Good to hear from you again, Jesse.  Sounds like a cool project!</p>
]]></content:encoded>
	</item>
</channel>
</rss><!-- Dynamic page generated in 0.422 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-02-05 04:45:28 -->
