<?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; Entity Framework</title>
	<atom:link href="http://DontForgetYourTODOs.com/tag/entity-framework/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>
		<item>
		<title>Oracle GUID Converter</title>
		<link>http://DontForgetYourTODOs.com/2009/08/oracle-guid-converter/</link>
		<comments>http://DontForgetYourTODOs.com/2009/08/oracle-guid-converter/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 19:00:25 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Shout Out]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://DontForgetYourTODOs.com/?p=417</guid>
		<description><![CDATA[Using the Entity Framework against Oracle requires the presence of a third party provider. It becomes even more difficult when one of the data types that you store is a GUID which is not natively supported in Oracle.]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 0px 10px 10px 0px; border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" alt="Oracle Guid Converter" src="http://robobunny.com/images/robo_head.png" align="left">Important lesson for those who prefer using GUIDs as record identifiers.</p>
<p>The MS SQL data type, <strong>uniqueidentifier, </strong>does not have a counterpart in Oracle. In the past it was easy to make the column CHAR(36), the max string length of a GUID. I was not in a situation to do this as we were dealing with the Entity Framework against Oracle.&nbsp; </p>
<p>Entity Framework is compatible with SQL Server out of the box and translates the uniqueidentifier column to GUID type. This is not the case for Oracle. The use of a third party adapter, <a href="http://http://www.devart.com/dotconnect/oracle/">dotConnect for Oracle</a>, is required. This provider requires that the storage data type for GUID be RAW(16).</p>
<h4>What&#8217;s the problem with RAW(16)?</h4>
<p>GUID representation</p>
<p><span style="border-right: black thin dashed; padding-right: 10px; border-top: black thin dashed; padding-left: 10px; padding-bottom: 10px; border-left: black thin dashed; padding-top: 10px; border-bottom: black thin dashed">{922B0A87-7A88-DE11-BBA7-0AEA0522E79F}</span></p>
<p>&nbsp;</p>
<p>RAW(16) representation</p>
<p><span style="border-right: black thin dashed; padding-right: 10px; border-top: black thin dashed; padding-left: 10px; padding-bottom: 10px; border-left: black thin dashed; padding-top: 10px; border-bottom: black thin dashed">870A2B92887A11DEBBA70AEA0522E79F</span></p>
<p>&nbsp;</p>
<p>As if it was not tough enough already to read and write a GUID. Now it is represented differently in Oracle!!??</p>
<p>The best solution that I discovered to get around this was through the use of a handy <a href="http://www.robobunny.com/cgi-bin/guid">GUID Converter</a>. I don&#8217;t know how many times I have relied on this to help me out. </p>
]]></content:encoded>
			<wfw:commentRss>http://DontForgetYourTODOs.com/2009/08/oracle-guid-converter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

