<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>//TODO: Create Blog Title &#187; .NET</title>
	<atom:link href="http://DontForgetYourTODOs.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://DontForgetYourTODOs.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 03:20:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The Entity Framework Balloon</title>
		<link>http://DontForgetYourTODOs.com/2009/09/the-entity-framework-balloon/</link>
		<comments>http://DontForgetYourTODOs.com/2009/09/the-entity-framework-balloon/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 19:00:38 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Entity Framework]]></category>

		<guid isPermaLink="false">http://DontForgetYourTODOs.com/?p=427</guid>
		<description><![CDATA[I have used the Entity Framework for two successful project implementations. In my opinion EF lies somewhere between &#34;awesome framework that makes application development a breeze&#34; and &#34;generic tool that requires too much effort to do anything besides out of the box&#34;. Before I explain myself, I need to identify the common patterns I think [...]]]></description>
			<content:encoded><![CDATA[<p>I have used the <a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx">Entity Framework</a> for two successful project implementations. In my opinion EF lies somewhere between &quot;awesome framework that makes application development a breeze&quot; and &quot;generic tool that requires too much effort to do anything besides out of the box&quot;.</p>
<p>Before I explain myself, I need to identify the common patterns I think are necessary in any application that needs to persist data:</p>
<table border="0" cellspacing="0" cellpadding="2" width="516">
<thead>
<tr>
<td valign="top" width="514"><strong>Common Data Access Tasks</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" width="514">Design and Create Database Tables</td>
</tr>
<tr>
<td valign="top" width="514">Write SQL Statements or Stored Procedures/Packages</td>
</tr>
<tr>
<td valign="top" width="514">Design and Create Logical Entities</td>
</tr>
<tr>
<td valign="top" width="514">Write Code to Map Entities to Database</td>
</tr>
<tr>
<td valign="top" width="514">Tune Database via Indexing, Constraints, and Referential Integrity (if RDBMS)</td>
</tr>
<tr>
<td valign="top" width="514">Unit Test Data Access Methods</td>
</tr>
<tr>
<td valign="top" width="514">Handle Transactions</td>
</tr>
</tbody>
</table>
<p>EF works to simplify the development for database dependent applications by removing the redundant work involved in each project. Namely, the below highlighted tasks:</p>
<table border="0" cellspacing="0" cellpadding="2" width="516">
<thead>
<tr>
<td valign="top" width="514"><strong>Common Data Access Tasks</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" width="514">Design and Create Database Tables</td>
</tr>
<tr style="background-color: yellowgreen">
<td valign="top" width="514">Write SQL Statements or Stored Procedures/Packages</td>
</tr>
<tr style="background-color: yellowgreen">
<td valign="top" width="514">Design and Create Logical Entities</td>
</tr>
<tr style="background-color: yellowgreen">
<td valign="top" width="514">Write Code to Map Entities to Database</td>
</tr>
<tr>
<td valign="top" width="514">Tune Database via Indexing, Constraints, and Referential Integrity (if RDBMS)</td>
</tr>
<tr>
<td valign="top" width="514">Unit Test Data Access Methods</td>
</tr>
<tr style="background-color: yellowgreen">
<td valign="top" width="514">Handle Transactions</td>
</tr>
</tbody>
</table>
<h4>What is so bad about Entity Framework?</h4>
<ol>
<li>Most developers do not know to optimize database operations. EF creates a sandbox so that they may do whatever the hell they want with the data. This will drive any DBA crazy when they are asked to make optimizations. </li>
<li>With 99% confidence, I believe that most of the .NET framework code is bug-free (or has yet to become a problem for me). Knowing this, we can believe that our EF SQL queries are probably legit. But isn&#8217;t it important to test our queries themselves through unit tests? The ability to unit test our own data access methods without requiring an active database (in-memory or XML defined?) is a necessary feature. </li>
<li>Consequently, the application is fully aware of the ties to the EF and cannot be tested without. Persistence ignorance support is necessary so that developers are not forced to implement additional interfaces or provide unnecessary references. </li>
<li>Developing N-Tiered Applications with EF is difficult. Reattach objects into the data context after client modifications requires too much work. </li>
<li>Lazy loading improves performance, but excess code is needed to check if a related set is loaded. If it is not loaded, additional code is required to perform the operation. Consequently, it could make database operations unnecessarily chatty. </li>
</ol>
<p>I am only able to list five points about what is bad about the EF, after working on it for 8 months. In that time I have managed to work around two of the five issues with ADO.NET Data Services (unit testing data access methods with a mock implementation and creating N-Tiered applications). Performance issues have cropped up that I am 100% confident would not exist if custom code had been written to manage data access.</p>
<h4></h4>
<h4>So what is the &#8216;Entity Framework Balloon&#8217;?</h4>
<p><a href="http://dontforgetyourtodos.com/wp-content/uploads/2009/09/squashed_balloons.jpg"><img style="border-right-width: 0px; margin: 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="squashed_balloons" align="right" src="http://dontforgetyourtodos.com/wp-content/uploads/2009/09/squashed_balloons_thumb.jpg" width="244" height="118" /></a></p>
<p>Someone once provided this analogy to me.</p>
<blockquote><p>If our project were a water balloon, each development task would have its own piece of space. The introduction of EF attempts to shrink the cost/time to do the redundant tasks by compressing that side of the balloon. But the other tasks have to go somewhere else, and their piece just gets bigger and requires more effort in the long run.</p>
</blockquote>
<p>There always seems to be a new tool for the job. EF obviously serves its purpose, but it fails at making everything as easy as it seems.</p>
<h4>.NET 4 with the new Entity Framework</h4>
<p>Looking ahead, the <a href="http://blogs.msdn.com/adonet/archive/2009/05/11/update-on-the-entity-framework-in-net-4-and-visual-studio-2010.aspx">ADO.NET Team Blog</a> has focused on a list of concerns for the next version of EF.&#160; They are focusing on improving:</p>
<ol>
<li>Enabling settings to make development simpler such as lazy loading, eager loading, and stored procedure mapping. </li>
<li>Improving the readability of the generated SQL. </li>
<li>Persistence Ignorance support, allowing you to write POCO and later tie them to Entity Framework or another Data Provider. </li>
<li>Better N-Tier Support allowing the serialized entities to include their own change tracking properties. </li>
<li>Model-First and Code-Only development!<br />
<h4>&#160;</h4>
<h4>Entity Framework Reading List:</h4>
<p><a href="http://msdn.microsoft.com/en-us/magazine/dd882522.aspx">Anti-Patterns to Avoid in N-Tier Applications</a>         <br /><a href="http://msdn.microsoft.com/en-us/magazine/cc700340.aspx">The Entity Framework in Layered Architectures</a>        <br /><a href="http://www.develop.com/entityframework4">What&#8217;s New and Cool in Entity Framework 4.0</a></p>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://DontForgetYourTODOs.com/2009/09/the-entity-framework-balloon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

