<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.objectsharp.com/cs/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>ObjectSharp</title><link>http://www.objectsharp.com/cs/blogs/default.aspx</link><description>The leading provider of Developer Services in Canada for the Microsoft .NET Platform.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.2)</generator><item><title>Bring on the 3rd major release of WPF (3.5 SP1 Beta is ready!)</title><link>http://www.objectsharp.com/cs/blogs/rburke/archive/2008/05/12/bring-on-the-3rd-major-release-of-wpf-3-5-sp1-beta-is-ready.aspx</link><pubDate>Mon, 12 May 2008 17:25:10 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:143361</guid><dc:creator>robburke.NET</dc:creator><slash:comments>0</slash:comments><description>A &amp;#8220;Week of WPF&amp;#8221; begins on Channel 9 with the announcement that the third major release of WPF (3.5 SP1) has gone beta!
Tim Sneath&amp;#8217;s blog entry has fantastic detail about what&amp;#8217;s coming in this release and all the download/update details (Silverlighters: see caveat below).
Folks attending my &amp;#8220;WPF for Line Of Business apps&amp;#8221; presentation on Thursday [...]...(&lt;a href="http://www.objectsharp.com/cs/blogs/rburke/archive/2008/05/12/bring-on-the-3rd-major-release-of-wpf-3-5-sp1-beta-is-ready.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=143361" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/rburke/archive/tags/.NET+3.5+SP1/default.aspx">.NET 3.5 SP1</category><category domain="http://www.objectsharp.com/cs/blogs/rburke/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://www.objectsharp.com/cs/blogs/rburke/archive/tags/Tech/default.aspx">Tech</category><category domain="http://www.objectsharp.com/cs/blogs/rburke/archive/tags/Tech+Events/default.aspx">Tech Events</category><category domain="http://www.objectsharp.com/cs/blogs/rburke/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Live Search is actually getting pretty good these days!</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/05/12/live-search-is-actually-getting-pretty-good-these-days.aspx</link><pubDate>Mon, 12 May 2008 16:52:47 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:143358</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/LiveSearchisactuallygettingprettygood_A2EB/image_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="200" alt="image" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/LiveSearchisactuallygettingprettygood_A2EB/image_thumb.png" width="244" align="right" border="0" /&gt;&lt;/a&gt; Live Search got a refresh recently and it's actually pretty good, dare I say may be even better than Google. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Performance:&lt;/strong&gt; The load times are very snappy now and it feels pretty much on par with google performance.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Image Search:&lt;/strong&gt; Functionality on Image Search has been superior for some time with the ability to size the thumbnails and I quite like the &amp;quot;add to scratchpad&amp;quot; feature but wish it was available for video and web content as well. The ability to refine the search by size, aspect ratio, colour, Style (photo vs. illustration) and Face (i.e. head &amp;amp; shoulders, just face, etc.) is brilliant. It's not 100% accurate, but it is still quite useful. Google can do a subset of this, but frankly, never noticed it until I went looking for it. These features are more discoverable in Live. I have to say that I'm in love with the fact that I can preview the context of the pages split screen so I don't leave my list of results. As far as relevancy goes, I'm going to have to give it a try for a week. Google does a better job finding pictures of me, but Live does a better job of finding black &amp;amp; whites of Darryl Sittler.&amp;#160; Live &lt;a href="http://search.live.com/images/results.aspx?q=%22Darryl+Sittler%22+filterui%3acolor-bw&amp;amp;scope=images&amp;amp;FORM=C4IR" target="_blank"&gt;found 12 good b&amp;amp;w's of the Sitler&lt;/a&gt; while &lt;a href="http://images.google.ca/images?as_q=&amp;amp;um=1&amp;amp;hl=en&amp;amp;btnG=Google+Search&amp;amp;as_epq=Darryl+Sittler&amp;amp;as_oq=&amp;amp;as_eq=&amp;amp;imgtype=&amp;amp;imgsz=&amp;amp;as_filetype=&amp;amp;imgc=mono&amp;amp;as_sitesearch=&amp;amp;safe=images&amp;amp;as_st=y" target="_blank"&gt;google found absolutely nothing of relevance&lt;/a&gt;. Unfortunately, Live fails my vanity image search and google prevails with more pictures of me.&amp;#160; &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Video Search&lt;/strong&gt;: I honestly have never used video search on live or google until this blog entry. Live has a nice feature where it can play videos from the results page by just hovering over the thumbnails. It can't do it for every video type, some you have to click on but it is a lovely feature when it works which from what I can tell is about 60% of the time. Google only manages to get 10 thumbnails per page where live gets twice that. Live brought back a few extra total results. It seems like google favours primarily youtube.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Map Search:&lt;/strong&gt; Mileage seems to vary greatly depending on where you are searching. Live has the great integrated 3D maps with buildings, contoured terrain and birds eye view vs. google with street view as it's killer feature. For Canadians, google hasn't made any of these features available yet. Live has thrown us Canadians a few bones with birds eye view available in Vancouver, Calgary, Toronto, and Montreal. Live also gives us some traffic in Vancouver, Toronto, Montreal, and Ottawa.       &lt;br /&gt;      &lt;br /&gt;Live maps has some great directional tools as well. I like the feature where I can just click on a point and ask for 1 click directions - which will give me generic instructions on coming to a location from all major available directions/arteries. This is great if you want to include directions on an invitation but you don't know where everybody is coming from. The Live Map collection editor and the ability to easily add pushpins and draw (with distances) on the map is great.       &lt;br /&gt;      &lt;br /&gt;One thing I do like about Google maps is the ability to take a set of directions and drag segments around to tell it how I really want to get somewhere. All in all though, I much prefer (as a Canadian) Live Maps as the most&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Plain Old Web Relevancy&lt;/strong&gt;: Plain old web results are perhaps the most important criteria. I think this will be impossible to provide any meaningful observations after spending &amp;lt; 1 hour using live search. I'm going to give live a shot as my default search engine for the next week and see how it does but a few immediate observations:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Live wins on relevancy for the &amp;quot;Barry Gervin&amp;quot; vanity search, easily. By the bottom of the first page (items 7th-9th), Google is showing results that are irrelevant - in fact, no mention of Barry or Gervin on any of those pages. &lt;/li&gt;      &lt;li&gt;Searching for some things that I know are on MSDN Forums - posted yesterday, google seems to be crawling that site faster than Live. Google still has a dedicated newsgroups search engine. I used to use this a lot more than I currently do so I have mixed emotions about live search. In fact, in some of my tests for searching things that I knew were known to exist in newsgroups, live search actually referred me to google groups - so it does appear that live is indexing the google groups search engine. I think the thing I find most appealing about google groups is not the content that it finds, but the way it presents it, showing me what group a result was found in, and then making the detailed results essentially a web based NNTP client. Live could do much more than they are doing now that's for sure, I'm just not sure that it really matters.&lt;/li&gt;      &lt;li&gt;I'm making more and more use of google alerts to have things I am constantly tracking or researching searched and emailed to me. Live has no equivalent to this. &lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;I'm going to give Live Search a trial as my default search engine for the next week or so and see how it goes. I'm optimistic.&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=143358" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Home/default.aspx">Home</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Services/default.aspx">Services</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Southern+Ontario/default.aspx">Southern Ontario</category></item><item><title>Visual Studio 2008 SP1 Beta &amp; SQL Server 2008</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/05/09/visual-studio-2008-sp1-beta-sql-server-2008.aspx</link><pubDate>Fri, 09 May 2008 20:30:10 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:143250</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;A quick heads up to let you know that VS 2008 Service Pack 1 is now available (links below). It typically takes a couple of months from this point before we'll see a final release.&lt;/p&gt;  &lt;p&gt;This Service Pack includes new cool feature:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx" target="_blank"&gt;ADO.NET Entity Framework&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://astoria.mslivelabs.com/" target="_blank"&gt;ADO.NET Data Services&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://astoria.mslivelabs.com/" target="_blank"&gt;ASP.NET 3.5 Extensions&lt;/a&gt; (aka Cicero) which includes MVC Framework, ASP.NET Silverlight Controls, Dynamic Data, New Ajax Nav/History Controls. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;One interesting point is that MS is going to simultaneously ship SQL Server 2008 which actually has a hard dependency on SP1.&lt;/p&gt;  &lt;p&gt;I thought I&amp;#8217;d take a moment to highlight some new features that Dev&amp;#8217;s would care about in &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-overview.aspx" target="_blank"&gt;SQL Server 2008&lt;/a&gt;.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Change Data Capture: Async &amp;#8220;triggers&amp;#8221; capture the before/after snapshot of row level changes and writes them to Change Tables that you can query in your app. They aren&amp;#8217;t real triggers as this asynchronously reads the transaction log.&lt;/li&gt;    &lt;li&gt;Granular control of encryption, right through to the database level without any application changes required.&lt;/li&gt;    &lt;li&gt;Resource Governor &amp;#8211; very helpful when you allow users to write adhoc queries / reports against your OLTP database. Allows a DBA to assert resource limits &amp;amp; priorities.&lt;/li&gt;    &lt;li&gt;Plan Freezing &amp;#8211; allows you to lock down query plans to promote stable query plans across disparate hardware, server upgrades, etc.&lt;/li&gt;    &lt;li&gt;New Date, and Time data types, no longer just DateTime types that you have to manually parse out the time or date to just get the real data you want.&lt;/li&gt;    &lt;li&gt;DataTimeOffset &amp;#8211; is a time zone aware datetime.&lt;/li&gt;    &lt;li&gt;Table Value Parameters to procs &amp;#8211; ever want to pass a result set as an arg to a proc?&lt;/li&gt;    &lt;li&gt;Hierarchy ID is a new system type for storing nodes in a hierarchy&amp;#8230;.implemented as a CLR User Defined Type.&lt;/li&gt;    &lt;li&gt;FileStream Data type allows blobish data to be surfaced in the database, but physically stored on the NTFS file system. &amp;#8230;.but with complete transactional consistency with the relational data and backup integration.&lt;/li&gt;    &lt;li&gt;New Geographic data support, store spatial data such as polygons, points and lines, and long/lat data types.&lt;/li&gt;    &lt;li&gt;Merge SQL statement allows you to insert, or update if a row already exists. &lt;/li&gt;    &lt;li&gt;New reporting services features such as access to reports from within Word &amp;amp; Excel, better SharePoint integration&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Personally, haven't spent any time with SQL Server 2008 but that's a great set of new features that I can hardly wait to start using in real-world applications. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Downloads&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;VS 2008 SP1&lt;/b&gt; : &lt;a href="http://download.microsoft.com/download/7/3/8/7382EA08-4DD6-4134-9B92-8585A5B07973/VS90sp1-KB945140-ENU.exe"&gt;http://download.microsoft.com/download/7/3/8/7382EA08-4DD6-4134-9B92-8585A5B07973/VS90sp1-KB945140-ENU.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;.NET 3.5 SP1&lt;/b&gt; : &lt;a href="http://download.microsoft.com/download/8/f/c/8fc1fe13-55de-4bf5-b43e-375daf01452e/dotNetFx35setup.exe"&gt;http://download.microsoft.com/download/8/f/c/8fc1fe13-55de-4bf5-b43e-375daf01452e/dotNetFx35setup.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;Express 2008 with SP1:&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;o &lt;a href="http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vbsetup.exe"&gt;http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vbsetup.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;o &lt;a href="http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vcsetup.exe"&gt;http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vcsetup.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;o &lt;a href="http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vcssetup.exe"&gt;http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vcssetup.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;o &lt;a href="http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vnssetup.exe"&gt;http://download.microsoft.com/download/F/E/7/FE754BA4-140B-413C-933F-8D35FB150F12/vnssetup.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;TFS 2008 SP1: &lt;/b&gt;&lt;a href="http://download.microsoft.com/download/a/e/2/ae2eb0ff-e687-4221-9c3e-9165a942bc1c/TFS90sp1-KB949786.exe"&gt;http://download.microsoft.com/download/a/e/2/ae2eb0ff-e687-4221-9c3e-9165a942bc1c/TFS90sp1-KB949786.exe&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Feedback Forum: &lt;a href="http://go.microsoft.com/fwlink/?LinkId=119125"&gt;http://go.microsoft.com/fwlink/?LinkId=119125&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a&gt;&amp;#160;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=143250" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Home/default.aspx">Home</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Newsletter/default.aspx">Newsletter</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/SQL/default.aspx">SQL</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Attaching old Content Database to new Web Application in MOSS 2007 or WSS 3.0</title><link>http://www.objectsharp.com/cs/blogs/max/archive/2008/05/08/attaching-old-content-database-to-new-web-application-in-moss-2007-or-wss-3-0.aspx</link><pubDate>Thu, 08 May 2008 20:20:36 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:143227</guid><dc:creator>max</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;If you have recently re-attached your content database to the new web application in SharePoint 2007 (whether because you have moved your SharePoint install or simply because you had to re-create the web application on your current server), you might have noticed a new error (Event ID: 5555; Event Source: Office SharePoint Server) occurring hourly in the Event Log of your web-front SharePoint server. 
&lt;/p&gt;&lt;p&gt;The description of the error tells you to run &lt;a href="http://technet2.microsoft.com/Office/en-us/library/279e8dc2-a9a9-47e5-b17c-3a00af4878de1033.mspx?mfr=true"&gt;stsadm – o preparetomove&lt;/a&gt;, which doesn't seem to fix the problem, unfortunately. This command only prevents the error 5555, if you run it before moving and re-attaching your content databases. To fix error 5555, you need to run &lt;a href="http://technet2.microsoft.com/Office/en-us/library/bbe7d4a4-524f-49f2-8264-d83014a062321033.mspx?mfr=true"&gt;stsadm –o sync&lt;/a&gt; instead.
&lt;/p&gt;&lt;p&gt;In my case, running the following command made error 5555 disappear:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;&lt;strong&gt;stsadm -o sync -DeleteOldDatabases 0
&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;As usual: &lt;em&gt;ALWAYS BACKUP YOUR SHAREPOINT BEFORE MAKING ANY CHANGES TO ITS CONFIGURATION&lt;/em&gt;&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=143227" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/max/archive/tags/Backup_2F00_restore/default.aspx">Backup/restore</category><category domain="http://www.objectsharp.com/cs/blogs/max/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://www.objectsharp.com/cs/blogs/max/archive/tags/Tips+_2600_amp_3B00_+Tricks/default.aspx">Tips &amp;amp; Tricks</category></item><item><title>The Entity Framework vs. The Data Access Layer (Part 1: The EF as a DAL)</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/05/06/the-entity-framework-vs-the-data-access-layer-part-1-the-ef-as-a-dal.aspx</link><pubDate>Wed, 07 May 2008 04:06:37 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:143110</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;In &lt;a href="http://www.objectsharp.com/cs/blogs/barry/archive/2008/04/27/the-entity-framework-vs-the-data-access-layer-part-0-introduction.aspx" target="_blank"&gt;Part 0: Introduction&lt;/a&gt; of this series after asking the question &amp;quot;Does the Entity Framework replace the need for a Data Access Layer?&amp;quot;, I waxed lengthy about the qualities of a good data access layer. Since that time I've received a quite a few emails with people interested in this topic. So without further adieu, let's get down to the question at hand.&lt;/p&gt;  &lt;p&gt;So let's say you go ahead and create an Entity Definition model (*.edmx) in Visual Studio and have the designer generate for you a derived ObjectContext class and an entity class for each of your tables, derived from EntityObject. This one to one table mapping to entity class is quite similar to LINQ to SQL but the mapping capabilities move well beyond this to support &lt;a href="http://msdn.microsoft.com/en-us/library/bb738640.aspx" target="_blank"&gt;advanced data models&lt;/a&gt;. This is at the heart of why the EF exists: &lt;a href="http://msdn.microsoft.com/en-us/library/bb738613.aspx" target="_blank"&gt;Complex Types&lt;/a&gt;, Inheritance (&lt;a href="http://msdn.microsoft.com/en-us/library/bb738685.aspx" target="_blank"&gt;Table per Type&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/bb738443.aspx" target="_blank"&gt;Table per Inheritance Hierarchy&lt;/a&gt;), &lt;a href="http://msdn.microsoft.com/en-us/library/bb738537.aspx" target="_blank"&gt;Multiple Entity Sets per Type&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/bb896233.aspx" target="_blank"&gt;Single Entity Mapped to Two Tables&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/bb896279.aspx" target="_blank"&gt;Entity Sets mapped to Stored Procedures&lt;/a&gt; or mapping to a hand-crafted query, expressed as either &lt;a href="http://msdn.microsoft.com/en-us/library/bb738450.aspx" target="_blank"&gt;SQL&lt;/a&gt; or &lt;a href="http://blogs.msdn.com/dsimmons/archive/2007/11/08/mapping-read-only-entities.aspx" target="_blank"&gt;Entity SQL&lt;/a&gt;. EF has a good story for a conceptual model over top of our physical databases using Xml Magic in the form of the edmx file - and that's why it exists. &lt;/p&gt;  &lt;p&gt;So to use the Entity Framework as your data access layer, define your model and then let the EdmGen.exe tool do it's thing to the edmx file at compile time and we get the csdl, ssdl, and msl files - plus the all important code generated entity classes. So using this pattern of usage for the Entity Framework, our data access layer is complete. It may not be the best option for you, so let's explore the qualities of this solution.&lt;/p&gt;  &lt;p&gt;To be clear, the assumption here is that our data access layer in this situation is the full EF Stack: ADO.NET Entity Client, ADO.NET Object Services, LINQ to Entities, including our model (edmx, csdl, ssdl, msl) and the code generated entities and object context. Somewhere under the covers there is also the ADO.NET Provider (SqlClient, OracleClient, etc.)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/image_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="417" alt="image" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/image_thumb_1.png" width="627" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To use the EF as our DAL, we would simply execute code similar to this in our business layer.&lt;/p&gt;  &lt;p&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;db = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;AdventureWorksEntities&lt;/span&gt;();     &lt;br /&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;activeCategories = &lt;span style="color:blue;"&gt;from &lt;/span&gt;category &lt;span style="color:blue;"&gt;in &lt;/span&gt;db.ProductCategory     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;where &lt;/span&gt;category.Inactive != true&lt;span style="color:blue;"&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; orderby &lt;/span&gt;category.Name     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:blue;"&gt;select &lt;/span&gt;category;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How Do &amp;quot;EF&amp;quot; Entities Fit In?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you're following along, you're probably asking exactly where is this query code above being placed. For the purposes of our discussion, &amp;quot;business layer&amp;quot; could mean a business object or some sort of controller. The point to be made here is that we need to think of Entities as something entirely different from our Business Objects. &lt;/p&gt;  &lt;p&gt;Entity != Business Object&lt;/p&gt;  &lt;p&gt;In this model, it is up to the business object to ask the Data Access Layer to project entities, not business objects, but entities. &lt;/p&gt;  &lt;p&gt;This is one design pattern for data access, but it is not the only one. A conventional business object that contains its own data, and does not separate that out into an entity can suffer from tight bi-directional coupling between the business and data access layer. Consider a Customer business object with a Load method. Customer.Load() would in turn instantiate a data access component, CustomerDac and call the CustomerDac's Load or Fill method. To encapsulate all the data access code to populate a customer business object, the CustomerDac.Load method would require knowledge of the structure the Customer business object and hence a circular dependency would ensue. &lt;/p&gt;  &lt;p&gt;The workaround, if you can call it that, is to put the business layer and the data access layer in the same assembly - but there goes decoupling, unit testing and separation of concerns out the window. &lt;/p&gt;  &lt;p&gt;Another approach is to invert the dependency. The business layer would contain data access interfaces only, and the data access layer would implement those interfaces, and hence have a reverse dependency on the business layer. Concrete data access objects are instantiated via a factory, often combined with configuration information used by an Inversion &lt;a href="http://www.martinfowler.com/articles/injection.html" target="_blank"&gt;of Control container&lt;/a&gt;. Unfortunately, this is not all that easy to do with the EF generated ObjectContext &amp;amp; Entities.&lt;/p&gt;  &lt;p&gt;Or, you do as the Entity Framework implies and separate entities from your business objects. If you've used typed DataSets in the past, this will seem familiar you to you. Substitute ObjectContext for SqlConnection and SqlDataAdapter, and the pattern is pretty much the same. &lt;/p&gt;  &lt;p&gt;Your UI presentation layer is likely going to bind to your Entity classes as well. This is an important consideration. The generated Entity classes are partial classes and can be extended with your own code. The generated properties (columns) on an entity also have event handlers created for changing and changed events so you can also wire those up to perform some column level validation. Notwithstanding, you may want to limit your entity customizations to simple validation and keep the serious business logic in your business objects. One of these days, I'll do another blog series on handing data validation within the Entity Framework.&lt;/p&gt;  &lt;h2&gt;How does this solution stack up?&lt;/h2&gt;  &lt;p&gt;&lt;strong&gt;How are database connections managed?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; Using the Entity Framework natively itself, the ObjectContext takes care of opening &amp;amp; closing connections for you - as needed when queries are executed, and during a call to SaveChanges. You can get access to the native ADO.NET connection if need be to share a connection with other non-EF data access logic. The nice thing however is that, for the most part, connection strings and connection management are abstracted away from the developer. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs down" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; A word of caution however. Because the ObjectContext will create a native connection, you should not wait to let the garbage collector free that connection up, but rather ensure that you dispose of the ObjectContext either explicitly or with a using statement.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Are all SQL Queries centralized in the Data Access Layer?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs down" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; By default the Entity Framework dynamically generates store specific SQL on the fly and therefore, the queries are not statically located in any one central location. Even to understand the possible queries, you'd have to walk through all of your business code that hits the entity framework to understand all of the potential queries. &lt;/p&gt;  &lt;p&gt;But why would you care? If you have to ask that question, then you don't care. But if you're a DBA, charged with the job of optimizing queries, making sure that your tables have the appropriate indices, then you want to go to one central place to see all these queries and tune them if necessary. If you care strongly enough about this, and you have the potential of other applications (perhaps written in other platforms), then you likely have already locked down the database so the only access is via Stored Procedures and hence the problem is already solved.&lt;/p&gt;  &lt;p&gt;Let's remind ourselves that sprocs are not innately faster than dynamic SQL, however they are easier to tune and you also have the freedom of using T-SQL and temp tables to do some pre-processing of data prior to projecting results - which sometimes can be the fastest way to generate some complex results. More importantly, you can revoke all permissions to the underlying tables and only grant access to the data via Stored Procedures. Locking down a database with stored procedures is almost a necessity if your &lt;a href="http://www.objectsharp.com/cs/blogs/barry/archive/2005/05/27/when-is-a-database-oriented-as-a-service.aspx" target="_blank"&gt;database is oriented as a service&lt;/a&gt;, acting as an integration layer between multiple client applications. If you have multiple applications hitting the same database, and you don't use stored procedures - you likely have bigger problems.&amp;#160; &lt;/p&gt;  &lt;p&gt;In the end, this is not an insurmountable problem. If you are already using Stored Procedures, then by all means you can map those in your EDM. This seems like the best approach, but you could also embed SQL Server (or other provider) queries in your SSDL using a &lt;a href="http://msdn.microsoft.com/en-us/library/bb738450.aspx" target="_blank"&gt;DefiningQuery&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Do changes in one part of the system affect others?&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;It's difficult to answer this question without talking about the possible changes.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;strong&gt;Schema Changes:&lt;/strong&gt; The conceptual model and the mapping flexibility, even under complex scenarios is a strength of the entity framework. Compared to other technologies on the market, with the EF, your chances are as good as they're going to get that a change in the database schema will have minimal impact on your entity model, and vice versa. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;strong&gt;Database Provider Changes:&lt;/strong&gt; The Entity Framework is database agnostic. It's provider model allows for easily changing from SQL Server, to Oracle, to My Sql, etc. via connection strings. This is very helpful for ISVs whose product must support running on multiple back-end databases. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs down" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;strong&gt;Persistence Ignorance&lt;/strong&gt;: What if the change you want in one part of the system is to change your ORM technology? Maybe you don't want to persist to a database, but instead call a CRUD web service. In this pure model, you won't be happy. Both your Entities and your DataContext object inherit from base classes in the Entity Framework's System.Data.Objects namespace. By making references to these, littered throughout your business layer, decoupling yourself from the Entity Framework will not be an easy task.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs down" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;strong&gt;Unit Testing&lt;/strong&gt;: This is only loosely related to the question, but you can't talk about PI without talking about Unit Testing. Because the generated entities do not support the use of Plain Old CLR Objects (POCO), this data access model is not easily mocked for unit testing. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Does the DAL simplify data access?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; Dramatically. Compared to classic ADO.NET, LINQ queries can be used for typed results &amp;amp; parameters, complete with intelli-sense against your conceptual model, with no worries about SQL injection attacks. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; As a bonus, what you do get is query composition across your domain model. Usually version 1.0 of a convention non-ORM data access layer provides components for each entity, each supporting crud behaviour. Consider a scenario where you need to show all of the Customers within a territory, and then you need to show the last 10 orders for each Customer. Now I'm not saying you'd do this, but what I've commonly seen is that while somebody might write a CustomerDac.GetCustomersByTerritory() method, and they might write an OrderDac.GetLastTenOrders(), they would almost never write a OrderDac.GetLastTenOrdersForCustomersInTerritory() method. Instead they would simply iterate over the collection of customers found by territory and call the GetLastTenOrders() over and over again. Obviously this is &amp;quot;good&amp;quot; resuse of the data access logic, however it does not perform very well. &lt;/p&gt;  &lt;p&gt;Fortunately, through query composition and eager loading, we can cause the Entity Framework (or even LINQ to SQL) to use a nested subquery to bring back the last 10 orders for each customer in a given territory in a single round trip, single query. Wow! In a conventional data access layer you could, and should write a new method to do the same, but by writing yet another query on the order table, you'd be repeating the mapping between the table and your objects each time. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Layers, Schmayers: What about tiers?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs down" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20down_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; EDM generated entity classes are not very tier-friendly. The state of an entity, whether it is modified, new, or to be delete, and what columns have changed is managed by the ObjectContext. Once you take an entity and serialize it out of process to another tier, it is no longer tracked for updates. While you can re-attach an entity that was serialized back into the data access tier, because the entity itself does not serialize it's changed state (aka diff gram), you can not easily achieve full round trip updating in a distributed system. There are techniques for dealing with this, but it is going to add some plumbing code between the business logic and the EF...and make you wish you had a real data access layer, or something like Danny Simmons' &lt;a href="http://code.msdn.microsoft.com/entitybag/" target="_blank"&gt;EntityBag&lt;/a&gt; (or a DataSet).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Does the Data Access Layer support optimistic concurrency?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; Out of the box, yes, handily. Thanks to the ObjectContext tracking state, and the change tracking events injected into our code generated entity properties. However, keep in mind the caveat with distributed systems that you'll have more work to do if your UI is separated from your data access layer by one or more tiers.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How does the Data Access Layer support transactions?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="19" alt="thumbs up" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/TheEn.TheDataAccessLayerPart1TheEFasaDAL_FD65/thumbs%20up_thumb.jpg" width="25" border="0" /&gt;&lt;/a&gt; Because the Entity Framework builds on top of ADO.NET providers, transaction management doesn't change very much. A single call to ObjectContext.SaveChanges() will open a connection, perform all inserts, updates, and deletes across all entities that have changed, across all relationships and all in the correct order....and as you can imagine in a single transaction. To make transactions more granular than that, call SaveChanges more frequently or have multiple ObjectContext instances for each unit of work in progress. To broaden the scope of a transaction, you can manually enlist using a native ADO.NET provider transaction or by using System.Transactions.&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=143110" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Home/default.aspx">Home</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Newsletter/default.aspx">Newsletter</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Services/default.aspx">Services</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/SQL/default.aspx">SQL</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/VS2008/default.aspx">VS2008</category></item><item><title>Live Search Maps - now with Bird's Eye View in Toronto</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/05/06/live-search-maps-now-with-bird-s-eye-view-in-toronto.aspx</link><pubDate>Tue, 06 May 2008 18:36:19 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:143099</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/LiveSearchMapsnowwithBirdsEyeViewinToron_CD1F/image_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="384" alt="image" src="http://www.objectsharp.com/cs/blogs/barry/WindowsLiveWriter/LiveSearchMapsnowwithBirdsEyeViewinToron_CD1F/image_thumb.png" width="477" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It's amazing what MS will give you, if you &lt;a href="http://www.objectsharp.com/devlounge/videos/playvideo.aspx?movie=ef789e34-f309-48ab-961e-9397ced8f59e" target="_blank"&gt;give them a Team Canada Hockey Jersey&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=143099" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Home/default.aspx">Home</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Humours+Distractions/default.aspx">Humours Distractions</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Southern+Ontario/default.aspx">Southern Ontario</category></item><item><title>Entity Framework Links for April, 2008</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/05/02/entity-framework-links-for-april-2008.aspx</link><pubDate>Fri, 02 May 2008 17:10:02 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142776</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>0</slash:comments><description>&lt;ul&gt;   &lt;li&gt;During the past month, Danny Simmons let us all officially know that &lt;a href="http://blogs.msdn.com/dsimmons/archive/2008/04/09/ef-will-ship-with-sp1-of-vs-2008-net-framework-3-5.aspx" target="_blank"&gt;SP1 of VS 2008/.NET Framework 3.5 will be the delivery mechanism for the Entity Framework&lt;/a&gt; and the Designer, and that we should see a beta of the entire SP1 very soon as well. No release dates yet. &lt;/li&gt;    &lt;li&gt;Speaking of the next beta, there have been some improvements in the designer to support iterative development. &lt;a href="http://blogs.msdn.com/adonet/archive/2008/04/01/update-model-from-db.aspx" target="_blank"&gt;Noam Ben-Ami talks about that here.&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;There is also a new ASP.NET EntityDataSource control coming in the next beta. Danny demo'd that at DevConnections, and &lt;a href="http://blogs.msdn.com/dsimmons/" target="_blank"&gt;Julie blogged about it here&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;In April, Microsoft released the .&lt;a href="http://go.microsoft.com/?linkid=8741672" target="_blank"&gt;NET 3.5 Enhancements Training Kit&lt;/a&gt;. This includes some preliminary labs on ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX History, ASP.NET Silverlight controls, ADO.NET Data Services and last but certainly not least, the ADO.NET Entity Framework. Stay tuned for updates &lt;/li&gt;    &lt;li&gt;Julie Lerman has created a spiffy &lt;a href="http://www.thedatafarm.com/blog/2008/04/29/AExtensionMethodForVisualizingEntityStateObjects.aspx" target="_blank"&gt;pseudo-debug visualizer for Entity State&lt;/a&gt;. It's implemented as an extension method and not a true debug visualizer, but useful just the same. &lt;/li&gt;    &lt;li&gt;Check out Ruurd Boeke's excellent post on &lt;a href="http://www.sitechno.com/Blog/DisconnectedNTierObjectsUsingEntityFramework.aspx" target="_blank"&gt;Disconnected N-Tier objects using the Entity Framework&lt;/a&gt;. His sample solution is checked in to the &lt;a href="http://www.codeplex.com/efcontrib" target="_blank"&gt;EFContrib Project&lt;/a&gt; and he demonstrates using POCO classes, in his words &amp;quot;as persistence ignorant as I can get&amp;quot;, serializing entities with no EF references on the clients, yet not losing full change tracking on the client - and using the same domain classes on the client and the server (one could argue this last point as being not being a desirable goal - but it does have it's place). &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142776" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Home/default.aspx">Home</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Newsletter/default.aspx">Newsletter</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/SQL/default.aspx">SQL</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/VS2008/default.aspx">VS2008</category></item><item><title>One Year Anniversary</title><link>http://www.objectsharp.com/cs/blogs/max/archive/2008/05/01/one-year-anniversary.aspx</link><pubDate>Thu, 01 May 2008 18:13:00 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142736</guid><dc:creator>max</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Today was my one year anniversary in my new job as an IT Manager at ObjectSharp. It's been an interesting year; a year full of new experiences and surprises, mostly good ones. 
&lt;/p&gt;&lt;p&gt;One year ago I have traded a job at a public sector for one in a private sector. I have traded a stable and secure environment with clear guidelines, managerial or supervision rules and specific working times for a more open managerial style, openness to new ideas and more flexibility in rules with fewer guidelines. And, honestly, I have no regrets so far. After a year, I'm having more fun than ever. It's fascinating working with a team of exceptional people from a range of disciplines whose commitment to excellence is steadfast. At ObjectSharp, I got a chance to work with the newest and coolest technologies from Microsoft (often even before those technologies were available to the general public.) Here, I am working with a talented team of professionals who not only know how to get those technologies to work, but they know how to make them work better and more efficient. I love it! 
&lt;/p&gt;&lt;p&gt;On sad note, today I was expecting balloons, hugs, high fives, or even just a disgusted "I can't believe your still here". Nothing. Well, there is still time... ;)
&lt;/p&gt;&lt;p&gt;&lt;em&gt;Note: Later that day I did get a few high fives, no balloons though &lt;span style="font-family:Wingdings;"&gt;J&lt;/span&gt;
		&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="http://www.objectsharp.com/images/one_year_candle.jpg" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt; 
 &lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142736" width="1" height="1"&gt;</description></item><item><title>Some References on Extensible XML Schema Design</title><link>http://www.objectsharp.com/cs/blogs/pmadziak/archive/2008/04/29/some-references-on-extensible-xml-schema-design.aspx</link><pubDate>Tue, 29 Apr 2008 18:58:00 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142567</guid><dc:creator>pmadziak</dc:creator><slash:comments>0</slash:comments><description>&lt;P&gt;This topic came up in a WCF training session (i.e. ObjectSharp's &lt;A class="" title="WCF Course" href="http://www.objectsharp.com/training/coursedetail.aspx?id=1135"&gt;WCF course&lt;/A&gt;) I am currently delivering so I wanted to post a few references on the subject here:&lt;/P&gt;
&lt;P&gt;The first is "Designing Extensible, Versionable XML Formats" by Dare Obasanjo&lt;BR&gt;&lt;A href="http://www.xml.com/pub/a/2004/07/21/design.html?page=1"&gt;http://www.xml.com/pub/a/2004/07/21/design.html?page=1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The second, slightly more academic treatment is "Extensibility, XML Vocabularies, and XML Schema", by David Orchard, an extensibility guru who has much to say on the topic:&lt;BR&gt;&lt;A href="http://www.xml.com/pub/a/2004/10/27/extend.html"&gt;http://www.xml.com/pub/a/2004/10/27/extend.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And then finally a series of writings&amp;nbsp;by Tim Ewald which are chock full of extremely powerful Versioning advice:&lt;/P&gt;
&lt;P&gt;First his "Services and the Versioning Problem" article in the MS Architecture Journal:&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/arcjournal/bb245674.aspx"&gt;http://msdn2.microsoft.com/en-us/arcjournal/bb245674.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And then a series of blog entries:&lt;BR&gt;&lt;A href="http://pluralsight.com/blogs/tewald/archive/2006/04/14/21733.aspx"&gt;http://pluralsight.com/blogs/tewald/archive/2006/04/14/21733.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://pluralsight.com/blogs/tewald/archive/2006/04/25/22704.aspx"&gt;http://pluralsight.com/blogs/tewald/archive/2006/04/25/22704.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://pluralsight.com/blogs/tewald/archive/2006/05/05/22961.aspx"&gt;http://pluralsight.com/blogs/tewald/archive/2006/05/05/22961.aspx&lt;/A&gt;&lt;BR&gt;&lt;A href="http://pluralsight.com/blogs/tewald/archive/2006/05/05/22963.aspx"&gt;http://pluralsight.com/blogs/tewald/archive/2006/05/05/22963.aspx&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142567" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/pmadziak/archive/tags/Services/default.aspx">Services</category><category domain="http://www.objectsharp.com/cs/blogs/pmadziak/archive/tags/WCF/default.aspx">WCF</category></item><item><title>Getting around the limitation on a number of controls on SharePoint page</title><link>http://www.objectsharp.com/cs/blogs/max/archive/2008/04/29/getting-around-the-limitation-on-a-number-of-controls-on-sharepoint-page.aspx</link><pubDate>Tue, 29 Apr 2008 14:53:42 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142560</guid><dc:creator>max</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Apparently there is a limit on a number of controls you can have on a SharePoint page. By default, no more than 200 controls are allowed on the SharePoint page. Not sure, why this limitation is there, but it is. To get around this problem, you need to increase the MaxControls setting in your web.config file:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeMode&lt;/span&gt;&lt;span style="color:blue;"&gt;
				&lt;/span&gt;&lt;span style="color:red;"&gt;MaxControls&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;/span&gt;&lt;span style="color:blue;font-size:20pt;"&gt;&lt;strong&gt;200&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:10pt;"&gt;"&lt;span style="color:blue;"&gt;
				&lt;/span&gt;&lt;span style="color:red;"&gt;CallStack&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;false&lt;/span&gt;"&lt;span style="color:blue;"&gt;
				&lt;/span&gt;&lt;span style="color:red;"&gt;DirectFileDependencies&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;10&lt;/span&gt;"&lt;span style="color:blue;"&gt;
				&lt;/span&gt;&lt;span style="color:red;"&gt;TotalFileDependencies&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;50&lt;/span&gt;"&lt;span style="color:blue;"&gt;
				&lt;/span&gt;&lt;span style="color:red;"&gt;AllowPageLevelTrace&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;"&lt;span style="color:blue;"&gt;false&lt;/span&gt;"&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;PageParserPaths&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;PageParserPaths&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10pt;"&gt;&lt;span style="color:blue;"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SafeMode&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;In my case, I have MaxControls parameter set to 300. 
&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142560" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/max/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://www.objectsharp.com/cs/blogs/max/archive/tags/Tips+_2600_amp_3B00_+Tricks/default.aspx">Tips &amp;amp; Tricks</category></item><item><title>Developing Streaming Pipeline Components - Part 5</title><link>http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/28/developing-streaming-pipeline-components-part-5.aspx</link><pubDate>Mon, 28 Apr 2008 20:12:33 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142510</guid><dc:creator>nbarden</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In the &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/24/developing-streaming-pipeline-components-part-4.aspx" target="_blank"&gt;Part 4&lt;/a&gt; I covered the &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.biztalk.streaming.xmltranslatorstream.aspx" target="_blank"&gt;XmlTranslatorStream&lt;/a&gt; in detail, explaining how it provides powerful &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/22/developing-streaming-pipeline-components-part-3.aspx" target="_blank"&gt;coupling of an XmlReader and XmlWriter&lt;/a&gt; as it is read.&amp;nbsp; This revealed how BizTalk manages to execute a pipeline of components in an efficient way - because it is actually reading a series of wrapped streams added by each component in the pipeline.&amp;nbsp; However, what the last post did not disclose was how we actually perform any useful processing now that we know how to process data in a streaming mode.&lt;/p&gt; &lt;p&gt;This post I will cover how we can achieve this streaming based processing of data - and give some examples of how and where BizTalk manages to do this with its out of the box components.&lt;/p&gt; &lt;p&gt;...&lt;/p&gt; &lt;p&gt;As I eluded to towards the end of &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/24/developing-streaming-pipeline-components-part-4.aspx" target="_blank"&gt;Part 4&lt;/a&gt;, processing data through the XmlTranslatorStream is pointless if you are simply providing an XML inbound stream, and reading from it an exact XML outbound stream, without performing some other processing function.&amp;nbsp; All this is achieving is slowing down the movement of data as it moves through the BizTalk streams by adding an extra layer of overhead.&amp;nbsp; However, because both the XmlReader and XmlTranslatorStream classes are very extensible, we can provide our own custom implementations of these to perform our processing.&lt;/p&gt; &lt;p&gt;In general, you have two main extensibility options:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Subclass XmlReader and perform your custom processing in there  &lt;ul&gt; &lt;li&gt;Then pass your custom XmlReader to the XmlTranslatorStream as its source of data  &lt;li&gt;Then set the XmlTranslatorStream as the message part's data&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Subclass XmlTranslatorStream and perform your custom processing in there  &lt;ul&gt; &lt;li&gt;Then set your subclass of XmlTranslatorStream as the message part's data&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Note that you can also perform a combination of both, but in most cases I think you would only really need to do one.&lt;/p&gt; &lt;p&gt;BizTalk ships with out of the box components that perform functionality such as:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;XML Data validation  &lt;li&gt;Data conversion (XML/Flat File)  &lt;li&gt;Property promotion/demotion  &lt;li&gt;Data manipulation (e.g. property demotion modifies the outbound data)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;All of these pieces of functionality are performed efficiently using a streaming approach - using a mixture of the extensibility options above to perform this processing logic.&amp;nbsp; Let's look at implementing some custom functionality, and placing the same logic in both a custom XmlReader and custom XmlTranslatorStream, to compare how each implementation would work.&lt;/p&gt; &lt;p&gt;Before we look at the code, I will go over some more details of how the XmlTranslatorStream works.&amp;nbsp; When XmlTranslatorStream's &lt;em&gt;ProcessXmlNodes&lt;/em&gt; method is called (see &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/24/developing-streaming-pipeline-components-part-4.aspx" target="_blank"&gt;Part 4&lt;/a&gt; for a detailed look at when this is called), it then advances its internal XmlReader and calls the &lt;em&gt;TranslateXmlNode&lt;/em&gt; method.&amp;nbsp; This method essentially performs a check on the current NodeType under the reader, and delegates to the appropriate TranslateXxx virtual method accordingly.&amp;nbsp; It provides a TranslateXxx method for every type of XML node, which is called when the corresponding node type is being copied from the XmlReader to the XmlWriter (see &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/22/developing-streaming-pipeline-components-part-3.aspx" target="_blank"&gt;Part 3&lt;/a&gt; for sample code on using the XmlReader.NodeType property to allow XmlReader to XmlWriter data duplication).&lt;/p&gt; &lt;p&gt;By providing all of the TranslateXxx methods as virtual, the XmlTranslatorStream allows us to easily intercept the nodes &amp;amp; values that are written from the XmlReader to the XmlWriter.&amp;nbsp; By allowing this, we can easily perform modification of the data &lt;em&gt;as it is being written&lt;/em&gt;.&amp;nbsp; We can easily choose to write our own values to the XmlWriter instead of the ones that were provided by the XmlReader, or we can choose not to write any data at all - essentially &lt;em&gt;removing&lt;/em&gt; the data from the stream.&amp;nbsp; This extensible design of the XmlTranslatorStream gives us very granular control over the output data.&lt;/p&gt; &lt;p&gt;Now, back to an example!&amp;nbsp; BizTalk ships with the &lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.biztalk.component.namespacetranslatorstream.aspx" target="_blank"&gt;NamespaceTranslatorStream&lt;/a&gt; class, which performs a streaming replacement of a specified XML namespace, given the old namespace to find and the new namespace to replace it with.&amp;nbsp; However, this stream is limited to only updating a single namespace per instance of the stream.&amp;nbsp; If you need to replace more than one namespace, you need to wrap each NamespaceTranslatorStream with another NamespaceTranslatorStream and give each one separate namespaces to replace.&amp;nbsp; This causes more overhead each layer of stream you add (note that NamespaceTranslatorStream derives from XmlTranslatorStream), and also makes the code that sets it up more verbose.&amp;nbsp; What would be nicer would be to have a single class that performs namespace replacements for any number of namespaces.&amp;nbsp; This can be easily achieved by creating our own subclass of XmlTranslatorStream.&lt;/p&gt; &lt;p&gt;Take a look at the following custom implementation of XmlTranslatorStream:&lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#008000;"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:#008000;"&gt;/// Allows the streaming replacement of multiple namespaces.&lt;/span&gt;
&lt;span style="color:#008000;"&gt;/// Note: This class could be easily enhanced to also update the prefix being written (if the ns0 prefixes that BizTalk generates are not wanted!).&lt;/span&gt;
&lt;span style="color:#008000;"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MultiNamespaceTranslatorStream : XmlTranslatorStream
{
    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; _namespaceReplacements;

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MultiNamespaceTranslatorStream(XmlReader reader) : &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;(reader) 
    {
        Initialise();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MultiNamespaceTranslatorStream(XmlReader reader, Encoding encoding) : &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;(reader, encoding) 
    {
        Initialise();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MultiNamespaceTranslatorStream(XmlReader reader, Encoding encoding, MemoryStream outputStream) : &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;(reader, encoding, outputStream) 
    {
        Initialise();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; NamespaceReplacements
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _namespaceReplacements; }
        set { _namespaceReplacements = &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;; }
    }

    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Initialise()
    {
        _namespaceReplacements = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;();
    }

    &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; ProcessXmlNodes(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; count)
    {
        &lt;span style="color:#008000;"&gt;// This method is called when the buffer in the base stream cannot fulfill the amount of data being requested&lt;/span&gt;
        &lt;span style="color:#008000;"&gt;// This in turn causes the reader to advance, and the data from the reader to be written to the writer &amp;amp; underlying buffer&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.ProcessXmlNodes(count);
    }

    &lt;span style="color:#008000;"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;/// Override to replace the namespaces of attributes being translated.&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; TranslateAttributeValue(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; prefix, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; localName, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; nsURI, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; val)
    {
        &lt;span style="color:#008000;"&gt;// Handle the default namespace declaration (has no prefix). Eg. xmlns="http://mynamespace"&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (((localName == &lt;span style="color:#006080;"&gt;"xmlns"&lt;/span&gt;) &amp;amp;&amp;amp; (nsURI == &lt;span style="color:#006080;"&gt;"http://www.w3.org/2000/xmlns/"&lt;/span&gt;)) &amp;amp;&amp;amp; (NamespaceReplacements.ContainsKey(val)))
        {
            &lt;span style="color:#008000;"&gt;// Replace the ns with the one configured&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.TranslateAttributeValue(prefix, localName, nsURI, NamespaceReplacements[val]);
        }
        &lt;span style="color:#008000;"&gt;// Handle non-default namespace declarations. Eg. xmlns:ns0="http://mynamespace"&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (((prefix == &lt;span style="color:#006080;"&gt;"xmlns"&lt;/span&gt;) &amp;amp;&amp;amp; (nsURI == &lt;span style="color:#006080;"&gt;"http://www.w3.org/2000/xmlns/"&lt;/span&gt;)) &amp;amp;&amp;amp; (NamespaceReplacements.ContainsKey(val)))
        {
            &lt;span style="color:#008000;"&gt;// Replace the ns with the one configured&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.TranslateAttributeValue(prefix, localName, nsURI, NamespaceReplacements[val]);
        }
        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
        {
            &lt;span style="color:#008000;"&gt;// Does not match a namespace configured to be replaced&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.TranslateAttributeValue(prefix, localName, nsURI, val);
        }
    }

    &lt;span style="color:#008000;"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;/// Override to replace the namespaces of elements being translated.&lt;/span&gt;
    &lt;span style="color:#008000;"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; TranslateStartElement(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; prefix, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; localName, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; nsURI)
    {
        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (NamespaceReplacements.ContainsKey(nsURI))
        {
            &lt;span style="color:#008000;"&gt;// Replace the ns with the one configured&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.TranslateStartElement(prefix, localName, NamespaceReplacements[nsURI]);
        }
        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
        {
            &lt;span style="color:#008000;"&gt;// Does not match a namespace configured to be replaced&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.TranslateStartElement(prefix, localName, nsURI);
        }
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that the key methods to override for performing this particular task are the &lt;em&gt;TranslateAttributeValue&lt;/em&gt;, which is called by the XmlTranslatorStream when an Attribute is being copied from its internal XmlReader over to the XmlWriter; and &lt;em&gt;TranslateStartElement&lt;/em&gt; - called when the start of an Element is being copied.&amp;nbsp; Also note that this class could be easily enhanced to also replace the prefix being written - for example if the &lt;em&gt;ns0&lt;/em&gt; style prefixes that BizTalk generates are not the prefixes that are needed.&lt;/p&gt;
&lt;p&gt;This can be easily tested with the following code.&amp;nbsp; Ensure that your sample file contains multiple namespaces to replace, and they match the ones configured:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; TranslateData_CustomTranslatorStream()
{
    &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt;(Stream output = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; FileStream(&lt;span style="color:#006080;"&gt;"MyOutputXmlFile.xml"&lt;/span&gt;, FileMode.Create, FileAccess.Write, FileShare.Read))
    {
        Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; nsReplacements = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;();
        &lt;span style="color:#008000;"&gt;// Set the replacement namespaces&lt;/span&gt;
        nsReplacements.Add(&lt;span style="color:#006080;"&gt;"http://originalNS1"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://newwackynamespace.com"&lt;/span&gt;);
        nsReplacements.Add(&lt;span style="color:#006080;"&gt;"http://originalNS2"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://anotherwackynamespace.com"&lt;/span&gt;);
        nsReplacements.Add(&lt;span style="color:#006080;"&gt;"http://originalNS3"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://runoutofwackynames.com"&lt;/span&gt;);
    
        &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (XmlReader reader = XmlReader.Create(&lt;span style="color:#006080;"&gt;"MyInputXmlFile.xml"&lt;/span&gt;))
        {
            &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (MultiNamespaceTranslatorStream stream = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; MultiNamespaceTranslatorStream(reader))
            {
                stream.NamespaceReplacements = nsReplacements;
                &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;;
                &lt;span style="color:#0000ff;"&gt;while&lt;/span&gt; ((&lt;span style="color:#0000ff;"&gt;value&lt;/span&gt; = stream.ReadByte()) != -1)
                    output.WriteByte((&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;)&lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;);
            }
        }
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now compare this to what you would have had to do to use BizTalk's built in NamespaceTranslatorStream:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#008000;"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color:#008000;"&gt;/// Translate a document with multiple namespaces using the NamespaceTranslatorStream. Wrap a NamespaceTranslatorStream per namespace to translate.&lt;/span&gt;
&lt;span style="color:#008000;"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Translate_MultipleNamespaces()
{
    &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (Stream output = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; FileStream(&lt;span style="color:#006080;"&gt;"MyOutputXmlFile.xml"&lt;/span&gt;, FileMode.Create))
    {
        &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (Stream fileStream = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; FileStream(&lt;span style="color:#006080;"&gt;"MyInputXmlFile.xml"&lt;/span&gt;, FileMode.Open, FileAccess.Read))
        {
            &lt;span style="color:#008000;"&gt;// Provide the old and replacement namespace for the first namespace.&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (Stream stream1 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; NamespaceTranslatorStream(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; PipelineContext(), fileStream, &lt;span style="color:#006080;"&gt;"http://originalNS1"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://newwackynamespace.com"&lt;/span&gt;))
            {
                &lt;span style="color:#008000;"&gt;// Wrap the first stream with another NamespaceTranslatorStream for the second namespace.&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (Stream stream2 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; NamespaceTranslatorStream(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; PipelineContext(), stream1, &lt;span style="color:#006080;"&gt;"http://originalNS2"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://anotherwackynamespace.com"&lt;/span&gt;))
                {
                    &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (Stream stream3 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; NamespaceTranslatorStream(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; PipelineContext(), stream2, &lt;span style="color:#006080;"&gt;"http://originalNS3"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://runoutofwackynames.com"&lt;/span&gt;))
                    {
                        &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;;
                        &lt;span style="color:#008000;"&gt;// Make sure the outer stream is the one being read!&lt;/span&gt;
                        &lt;span style="color:#0000ff;"&gt;while&lt;/span&gt; ((&lt;span style="color:#0000ff;"&gt;value&lt;/span&gt; = stream3.ReadByte()) != -1)
                            output.WriteByte((&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;)&lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;);
                    }
                }
            }
        }
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So, this simple custom class that is less than 100 lines of code long should help you start to see how real world problems can be solved using a streaming approach.&amp;nbsp; This small class allows you to avoid loading the entire XML message into the DOM and updating via the inefficient in memory approach.&lt;/p&gt;
&lt;p&gt;Now let's take a look at how we could have achieved the same result by utilising a custom XmlReader.&amp;nbsp; The concept is similar in that we are changing the view of data at specific points - in this example, when we see data that is using a namespace we need to change.&amp;nbsp; However, because the XmlReader exposes its view of the data via properties, rather than specific virtual methods augmented by parameters, this time we want to create an XmlReader that changes the view of data exposed by its properties.&lt;/p&gt;
&lt;p&gt;This is performed by the custom XmlReader in the following code.&amp;nbsp; Note that if this were to be used within BizTalk, this XmlReader would then be passed to the constructor of the XmlTranslatorStream:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MultiNamespaceTranslatorReader : XmlReader
{
    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; _inAttribute;
    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; XmlReader _wrappedReader;
    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; _namespaceReplacements;

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MultiNamespaceTranslatorReader(XmlReader wrappedReader) : &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;(wrappedReader, &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
    { }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MultiNamespaceTranslatorReader(XmlReader wrappedReader, 
        Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; namespaceReplacements)
    {
        Initialise(wrappedReader, namespaceReplacements);
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; NamespaceReplacements
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _namespaceReplacements; }
        set { _namespaceReplacements = &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;; }
    }

    &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; XmlReader WrappedReader
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _wrappedReader; }
        set { _wrappedReader = &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;; }
    }

    &lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; InAttribute
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; _inAttribute; }
        set { _inAttribute = &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; AttributeCount
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.AttributeCount; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; BaseURI
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.BaseURI; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Close()
    {
        WrappedReader.Close();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; Depth
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.Depth; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; EOF
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.EOF; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; GetAttribute(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; i)
    {
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.GetAttribute(i);
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; GetAttribute(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; name, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; namespaceURI)
    {
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.GetAttribute(name, namespaceURI);
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; GetAttribute(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; name)
    {
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; GetAttribute(name);
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; HasValue
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.HasValue; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; IsEmptyElement
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.IsEmptyElement; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; LocalName
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.LocalName; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; LookupNamespace(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; prefix)
    {
        &lt;span style="color:#008000;"&gt;// Check if the namespace for this prefix has been replaced&lt;/span&gt;
        &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; ns = WrappedReader.LookupNamespace(prefix);
        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (NamespaceReplacements.ContainsKey(ns))
            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; NamespaceReplacements[ns];
        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; ns;
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; MoveToAttribute(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; name, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; ns)
    {
        InAttribute = WrappedReader.MoveToAttribute(name, ns);
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; InAttribute;
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; MoveToAttribute(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; name)
    {
        InAttribute = WrappedReader.MoveToAttribute(name);
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; InAttribute;
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; MoveToElement()
    {
        InAttribute = !WrappedReader.MoveToElement();
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; !InAttribute;
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; MoveToFirstAttribute()
    {
        InAttribute = WrappedReader.MoveToFirstAttribute();
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; InAttribute;
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; MoveToNextAttribute()
    {
        InAttribute = WrappedReader.MoveToNextAttribute();
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; InAttribute;
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; XmlNameTable NameTable
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.NameTable; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; NamespaceURI
    {
        get 
        { 
            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(NamespaceReplacements.ContainsKey(WrappedReader.NamespaceURI))
                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; NamespaceReplacements[WrappedReader.NamespaceURI];
            &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.NamespaceURI;
        }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; XmlNodeType NodeType
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.NodeType; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Prefix
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.Prefix; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; Read()
    {
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.Read();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; ReadAttributeValue()
    {
        &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.ReadAttributeValue();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; ReadState ReadState
    {
        get { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.ReadState; }
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ResolveEntity()
    {
        WrappedReader.ResolveEntity();
    }

    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Value
    {
        get
        {
            &lt;span style="color:#008000;"&gt;// When reading an attribute (i.e. InAttribute is true), the Value property will&lt;/span&gt;
            &lt;span style="color:#008000;"&gt;// contain the actual namespace of the attribute.&lt;/span&gt;
            &lt;span style="color:#008000;"&gt;// E.g. For attribute: xmlns:ns0="http://mynamespace", Value = "http://mynamespace"&lt;/span&gt;
            &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (InAttribute &amp;amp;&amp;amp; NamespaceReplacements.ContainsKey(WrappedReader.Value))
                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; NamespaceReplacements[WrappedReader.Value];
            &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
                &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; WrappedReader.Value;
        }
    }

    &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Initialise(XmlReader wrappedReader, Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; namespaceReplacements)
    {
        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (wrappedReader == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
            &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color:#006080;"&gt;"wrappedReader"&lt;/span&gt;);

        _wrappedReader = wrappedReader;

        &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (namespaceReplacements == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)
            _namespaceReplacements = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;();
        &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;
            _namespaceReplacements = namespaceReplacements;
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that our custom XmlReader just becomes a special type of "filter" over an existing XmlReader, which we wrap.&amp;nbsp; We can then delegate any calls directly down to the wrapped XmlReader if it is dealing with data that we are not concerned with.&amp;nbsp; Otherwise, we can intercept the call to the wrapped implementation, and return our own data instead.&lt;/p&gt;
&lt;p&gt;This can be tested with the following code:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; TranslateData_CustomTranslatorReader()
{
    Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt; nsReplacements = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&amp;gt;();

    nsReplacements.Add(&lt;span style="color:#006080;"&gt;"http://CBR.CBRInputSchema"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://newwackynamespace.com"&lt;/span&gt;);
    nsReplacements.Add(&lt;span style="color:#006080;"&gt;"http://secondnamespace"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://anotherwackynamespace.com"&lt;/span&gt;);
    nsReplacements.Add(&lt;span style="color:#006080;"&gt;"http://thirdnamespace"&lt;/span&gt;, &lt;span style="color:#006080;"&gt;"http://runoutofwackynames.com"&lt;/span&gt;);

    XmlWriterSettings settings = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; XmlWriterSettings();
    settings.OmitXmlDeclaration = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
    settings.Indent = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;
    &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt;(XmlWriter writer = XmlWriter.Create(_output, settings))
    {
        &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (XmlReader reader = XmlReader.Create(Constants.SampleFilePath_MultiNamespace))
        {
            &lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; (XmlReader nsTransReader = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; MultiNamespaceTranslatorReader(reader, nsReplacements))
            {
                &lt;span style="color:#008000;"&gt;// WriteNode writes out EVERY node from the reader to the writer&lt;/span&gt;
                &lt;span style="color:#008000;"&gt;// However, there is no way to get it to write just a SINGLE node&lt;/span&gt;
                writer.WriteNode(nsTransReader, &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;);
            }
        }
    }
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After seeing the two different approaches, hopefully you can now see the how each allows for the custom processing of data by BizTalk by intercepting the inbound data as it is written back out.&amp;nbsp; I personally believe that subclassing the XmlReader is the better approach, because the XmlReader was designed as a "view" of XML data, and it allows clients to see your modified view in an XML sense, &lt;em&gt;as it is read&lt;/em&gt;.&amp;nbsp; By subclassing the XmlTranslatorStream, you are changing the &lt;em&gt;output stream&lt;/em&gt; of data for the next person who reads that stream.&amp;nbsp; They then have to create their own XmlReader to read over that stream anyway, which you could have done for them already just by implementing your logic as an XmlReader.&amp;nbsp; The main issue I believe with the XmlReader approach is that you need to have an understanding of the operations it provides, as you may be impacting how they need to function.&amp;nbsp; Take my custom XmlReader as an example - I needed to override the &lt;em&gt;LookupNamespace&lt;/em&gt; method, otherwise it would have behaved incorrectly.&amp;nbsp; However, this may not be immediately obvious.&lt;/p&gt;
&lt;p&gt;Well, that pretty much completes this series of 5 posts detailing how to develop streaming pipeline components.&amp;nbsp; I hope that from &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/14/developing-streaming-pipeline-components-part-1.aspx" target="_blank"&gt;Part 1&lt;/a&gt; through to this fifth one I have managed to fill in a number of gaps in the "art" of developing streaming pipeline components, and save you the many hours that I spent investigating this technique.&amp;nbsp; From what I have found, there is very little documented both officially and in blogs about &lt;em&gt;how&lt;/em&gt; to develop proper streaming components, rather than the &lt;em&gt;why&lt;/em&gt;, and also very little detail on what already comes with BizTalk that you can easily take advantage of.&amp;nbsp; There are only a handful of posts that I could find indicating that others are aware of what you get out of the box in this area, and that they understand how to use them - see &lt;a href="http://martijnh.blogspot.com/2006/03/xpathmutatorstream.html" target="_blank"&gt;here&lt;/a&gt;, &lt;a href="http://blogical.se/blogs/johan/archive/2008/01/07/removing-xml-namespace-in-a-pipeline-component.aspx" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://geekswithblogs.net/cyoung/articles/11586.aspx" target="_blank"&gt;here&lt;/a&gt; .&amp;nbsp; There are many more classes that ship with BizTalk which aid in developing your streaming components, which I have not yet covered.&amp;nbsp; These include the classes that implement the features I pointed out at the top such as validation and property promotion &amp;amp; demotion.&amp;nbsp; I plan to cover many of these in detail in future posts.&amp;nbsp; However, they follow the pattern which I have described in the last 5 posts (most are implemented as custom XmlReaders or custom XmlTranslatorStreams), and as a result I will not add them as posts under the banner of this series.&amp;nbsp; They are more or less a follow-on to this series.&amp;nbsp; Over and out!&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142510" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/nbarden/archive/tags/.net/default.aspx">.net</category><category domain="http://www.objectsharp.com/cs/blogs/nbarden/archive/tags/BizTalk/default.aspx">BizTalk</category></item><item><title>Team System Web Access 2008 SP1 CTP and Work Item Web Access 2008 CTP are now available</title><link>http://www.objectsharp.com/cs/blogs/max/archive/2008/04/28/team-system-web-access-2008-sp1-ctp-and-work-item-web-access-2008-ctp-are-now-available.aspx</link><pubDate>Mon, 28 Apr 2008 14:51:29 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142506</guid><dc:creator>max</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=A06ED577-DE38-426F-9341-3F78E46DA09A&amp;amp;displaylang=en"&gt;Team System Web Access 2008 SP1 CTP&lt;/a&gt; (Community Technology Preview) and &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FAED8359-F54D-480E-8A86-F154D3DEA07E&amp;amp;displaylang=en"&gt;Work Item Web Access 2008 CTP&lt;/a&gt; are now available for download. Even though it's only CTP version at the moment, don't let it discourage from using it, because it seems to be working very well. By the way, you still have to have Team Explorer 2008 installed to use TWSA and/or WIWA, which is not a big deal since it's free and most of us already have it installed anyway. For those who don't have Team Explorer 2008 installed, it can be downloaded for free from &lt;a href="http://www.microsoft.com/Downloads/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&amp;amp;displaylang=en"&gt;http://www.microsoft.com/Downloads/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&amp;amp;displaylang=en&lt;/a&gt;. 
&lt;/p&gt;&lt;p&gt;Team System Web Access 2008 SP1 has some really great features:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Single instance with multiple languages (9 languages are available: ENU, CHS, CHT, DEU, ESN, FRA, ITA, JPN, KOR)
&lt;/li&gt;&lt;li&gt;Support for specifying field values in the URL for creating new work items (works in both TSWA and WIWA) 
&lt;/li&gt;&lt;li&gt;Share ad-hoc work item queries 
&lt;/li&gt;&lt;li&gt;Shelveset viewer 
&lt;/li&gt;&lt;li&gt;Improved search support
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Team System Work Item Web Access 2008 CTP allows users to use some work item tracking feature without having TFS client access license (CAL.) A user without TFS CAL can use WIWA to: 
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Create new work items 
&lt;/li&gt;&lt;li&gt;Edit the work item you have created 
&lt;/li&gt;&lt;li&gt;See the list of work items you have created
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;However, user cannot: 
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;See work items created by others 
&lt;/li&gt;&lt;li&gt;List, view, edit or run work item queries 
&lt;/li&gt;&lt;li&gt;Add, edit or remove work item links (except attachments and hyperlinks) 
&lt;/li&gt;&lt;li&gt;Access documents stored on the project portal 
&lt;/li&gt;&lt;li&gt;Access project reports 
&lt;/li&gt;&lt;li&gt;Access source control 
&lt;/li&gt;&lt;li&gt;Access team build
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Specs for WIWA can be found at &lt;a href="http://msdn2.microsoft.com/en-us/teamsystem/bb936702.aspx"&gt;http://msdn2.microsoft.com/en-us/teamsystem/bb936702.aspx&lt;/a&gt;
	&lt;/p&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142506" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/max/archive/tags/TFS/default.aspx">TFS</category></item><item><title>The Entity Framework vs. The Data Access Layer (Part 0: Introduction)</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/04/27/the-entity-framework-vs-the-data-access-layer-part-0-introduction.aspx</link><pubDate>Mon, 28 Apr 2008 03:20:00 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142491</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>3</slash:comments><description>&lt;P&gt;So the million dollar question is: Does the Entity Framework replace the need for a Data Access Layer? If not, what should my Data Access Layer look like if I want to take advantage of the Entity Framework? In this multi-part series, I hope to explore my thoughts on this question. I don't think there is a single correct answer. Architecture is about trade offs and the choices you make will be based on your needs and context.&lt;/P&gt;
&lt;P&gt;In this first post, I first provide some background on the notion of a Data Access Layer as a frame of reference, and specifically, identify the key goals and objectives of a Data Access Layer.&lt;/P&gt;
&lt;P&gt;While Martin Fowler didn't invent the pattern of layering in enterprise applications, his &lt;A href="http://www.amazon.ca/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1209349729&amp;amp;sr=8-1" target=_blank&gt;Patterns of Enterprise Application Architecture&lt;/A&gt; is a must read on the topic. Our goals for a layered design (which may often need to be traded off against each other) should include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Changes to one part or layer of the system should have minimal impact on other layers of the system. This reduces the maintenance involved in unit testing, debugging, and fixing bugs and in general makes the architecture more flexible. &lt;/LI&gt;
&lt;LI&gt;Separation of concerns between user interface, business logic, and persistence (typically in a database) also increases flexibility, maintainability and reusability.&lt;/LI&gt;
&lt;LI&gt;Individual components should be cohesive and unrelated components should be loosely coupled. This should allow layers to be developed and maintained independently of each other using well-defined interfaces.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Now to be clear, I'm talking about a layer, not a tier. A tier is a node in a distributed system, of which may include one or more layers. But when I refer to a layer, I'm referring only to the logical separation of code that serves a single concern such as data access. It may or may not be deployed into a separate tier from the other layers of a system. We could then begin to fly off on tangential discussions of distributed systems and service oriented architecture, but I will do my best to keep this discussion focused on the notion of a layer. There are several layered application architectures, but almost all of them in some way include the notion of a Data Access Layer (DAL). The design of the DAL will be influenced should the application architecture include the distribution of the DAL into a separate tier. &lt;/P&gt;
&lt;P&gt;In addition to the goals of any layer mentioned above, there are some design elements specific to a Data Access Layer common to the many layered architectures:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A DAL in our software provides simplified access to data that is stored in some persisted fashion, typically a relational database. The DAL is utilized by other components of our software so those other areas of our software do not have to be overly concerned with the complexities of that data store. &lt;/LI&gt;
&lt;LI&gt;In object or component oriented systems, the DAL typically will populate objects, converting rows and their columns/fields into objects and their properties/attributes. this allows the rest of the software to work with data in an abstraction that is most suitable to it. &lt;/LI&gt;
&lt;LI&gt;A common purpose of the DAL is to provide a translation between the structure or schema of the store and the desired abstraction in our software. As is often the case, the schema of a relational database is optimized for performance and data integrity (i.e. 3rd normal form) but this structure does not always lend itself well to the conceptual view of the real world or the way a developer may want to work with the data in an application. A DAL should serve as a central place for mapping between these domains such as to increase the maintainability of the software and provide an isolation between changes&amp;nbsp; in the storage schema and/or the domain of the application software. This may include the marshalling or coercing of differing data types between the store and the application software.&lt;/LI&gt;
&lt;LI&gt;Another frequent purpose of the DAL is to provide independence between the application logic and the storage system itself such that if required, the storage engine itself could be switched with an alternative with minimal impact to the application layer. This is a common scenario for commercial software products that must work with different vendors' database engines (i.e. MS SQL Server, IBM DB/2, Oracle, etc.). With this requirement, sometimes alternate DAL's are created for each store that can be swapped out easily.&amp;nbsp; This is commonly referred to as Persistence Ignorance.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Getting a little more concrete, there are a host of other issues that also need to be considered in the implementation of a DAL:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;How will database connections be handled? How will there lifetime be managed? A DAL will have to consider the security model. Will individual users connect to the database using their own credentials? This maybe fine in a client-server architecture where the number of users is small. It may even be desirable in those situations where there is business logic and security enforced in the database itself through the use of stored procedures, triggers, etc. It may however run incongruent to the scalability requirements of a public facing web application with thousands of users. In these cases, a connection pool may be the desired approach.&lt;/LI&gt;
&lt;LI&gt;How will database transactions be handled? Will there be explicit database transactions managed by the data access layer or will automatic or implied transaction management systems such as COM+ Automatic Transactions, the Distributed Transaction Coordinator be used?&lt;/LI&gt;
&lt;LI&gt;How will concurrent access to data be managed? Most modern application architecture's will rely on an optimistic concurrency&amp;nbsp; to improve scalability. Will it be the DAL's job to manage the original state of a row in this case? Can we take advantage of SQL Server's row version timestamp column or do we need to track every single column?&lt;/LI&gt;
&lt;LI&gt;Will we be using dynamic SQL or stored procedures to communicate with our database? &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As you can see, there is much to consider just in generic terms, well before we start looking at specific business scenarios and the wacky database schemas that are in the wild. All of these things can and should influence the design of your data access layer and the technology you use to implement it. In terms of .NET, the Entity Framework is just one data access technology. MS has been so kind to bless us with many others such as Linq To SQL, DataReaders, DataAdapters &amp;amp; DataSets, and SQL XML. In addition, there are over &lt;A href="http://www.howtoselectguides.com/dotnet/ormapping/#section-vendors" target=_blank&gt;30 3rd party Object Relational Mapping tools available to choose from&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;Ok, so if you're&amp;nbsp; not familiar with the design goals of the Entity Framework (EF) you can &lt;A href="http://msdn2.microsoft.com/en-us/library/aa697427(vs.80).aspx" target=_blank&gt;read all about it here&lt;/A&gt; or watch a &lt;A href="http://channel9.msdn.com/ShowPost.aspx?PostID=217633" target=_blank&gt;video interview on channel 9&lt;/A&gt;, with &lt;A href="http://blogs.msdn.com/pablo/" target=_blank&gt;Pablo Castro&lt;/A&gt;, Britt Johnson, and Michael Pizzo. A year after that interview, they did a &lt;A href="http://channel9.msdn.com/showpost.aspx?postid=338257" target=_blank&gt;follow up interview here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In the next post, I'll explore the idea of the Entity Framework replacing my data access layer and evaluate how this choice rates against the various objectives above. I'll then continue to explore alternative implementations for a DAL using the Entity Framework.&lt;/P&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142491" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Home/default.aspx">Home</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Newsletter/default.aspx">Newsletter</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Services/default.aspx">Services</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/SQL/default.aspx">SQL</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/TechEd/default.aspx">TechEd</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/VS2008/default.aspx">VS2008</category></item><item><title>Countdown to DevTeach</title><link>http://www.objectsharp.com/cs/blogs/barry/archive/2008/04/25/countdown-to-devteach.aspx</link><pubDate>Sat, 26 Apr 2008 01:25:00 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142353</guid><dc:creator>Barry Gervin</dc:creator><slash:comments>0</slash:comments><description>&lt;P&gt;May 12th is just around the corner and I'm getting excited about DevTeach coming to Toronto for the first time. &lt;A href="http://guy.dotnet-expertise.com/PermaLink,guid,d94fb145-722c-4b78-948b-a6fe0a08209b.aspx" target=_blank&gt;Guy says it all.&lt;/A&gt; DevTeach is unusual in that while the sessions are great, hanging around with the Speakers is what it's all about. I'm really looking forward to it. It's not too late to &lt;A href="http://www.devteach.com/Register.aspx" target=_blank&gt;register&lt;/A&gt;. The 3 days of the main conference cost only $1200. Pre &amp;amp; Post cons are only $375/day. Some great sessions on Agile Development, .NET 2.0 through 3.5, .NET Futures, SharePoint, SQL, Architecture, BizTalk, and RockBand! &lt;/P&gt;
&lt;P&gt;Hope to see you there.&lt;/P&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142353" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Events/default.aspx">Events</category><category domain="http://www.objectsharp.com/cs/blogs/barry/archive/tags/Southern+Ontario/default.aspx">Southern Ontario</category></item><item><title>It’s cool to be a geek…</title><link>http://www.objectsharp.com/cs/blogs/dave/archive/2008/04/25/it-s-cool-to-be-a-geek.aspx</link><pubDate>Fri, 25 Apr 2008 17:40:00 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142336</guid><dc:creator>dave</dc:creator><slash:comments>0</slash:comments><description>&lt;SPAN style="FONT-SIZE:1pt;FONT-FAMILY:'Calibri','sans-serif';mso-ascii-theme-font:minor-latin;mso-fareast-font-family:'Times New Roman';mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:'Times New Roman';mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;/SPAN&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;/FONT&gt;
&lt;P class=Publishwithline style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Publishwithline style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face=Calibri size=3&gt;Do you remember when it was &lt;STRONG&gt;not&lt;/STRONG&gt; cool to be a geek?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Publishwithline style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Publishwithline style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face=Calibri size=3&gt;Not that I ever let it bother me. &lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;I have attended every PDC since 2001. It’s tough to be the coolest guy out of 8000. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Publishwithline style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;FONT face=Calibri size=3&gt;Now a days it's&amp;nbsp;cool to be a geek , people are coming out of the wood work to proclaim their geekyness with pride. Below are three examples I came across in the past few weeks. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;FONT face=Calibri size=3&gt;&lt;FONT face=Calibri size=3&gt;1. A developer who changed his girlfriend’s favorite game (beleweled) so when she achieved a certain score it displayed &lt;/FONT&gt;&lt;A href="http://xo.typepad.com/blog/2008/04/man-proposes-vi.html"&gt;&lt;FONT face=Calibri size=3&gt;display a proposal of marriage.&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;FONT face=Calibri size=3&gt;2&lt;/FONT&gt;&lt;FONT face=Calibri size=3&gt;. I remember when that one kid in a class with a laptop was the geek. Who’s the outcast now? &lt;/FONT&gt;&lt;A href="http://www.objectsharp.com/cs/photos/dave/images/142333/original.aspx" target=_blank&gt;&lt;IMG src="http://www.objectsharp.com/cs/photos/dave/images/142333/original.aspx" border=0&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;3. Cat 5 Wedding rings, need I say more. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY:Wingdings;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;SPAN style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY:Wingdings;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;SPAN style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;A href="http://www.objectsharp.com/cs/photos/dave/images/142334/original.aspx" target=_blank&gt;&lt;IMG src="http://www.objectsharp.com/cs/photos/dave/images/142334/452x375.aspx" border=0&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt 0.25in;LINE-HEIGHT:115%;"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY:Wingdings;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;SPAN style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;A href="http://www.objectsharp.com/cs/photos/dave/picture142334.aspx" target=_blank&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt 0.25in;LINE-HEIGHT:115%;"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY:Wingdings;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;SPAN style="mso-char-type:symbol;mso-symbol-font-family:Wingdings;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt 0.25in;LINE-HEIGHT:115%;"&gt;&lt;A href="http://www.engadget.com/2008/04/22/cat-5-wedding-rings-help-nerds-couple/"&gt;&lt;SPAN style="COLOR:windowtext;TEXT-DECORATION:none;text-underline:none;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-ignore:vglayout;"&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://www.objectsharp.com/cs/aggbug.aspx?PostID=142336" width="1" height="1"&gt;</description><category domain="http://www.objectsharp.com/cs/blogs/dave/archive/tags/Just+for+Fun/default.aspx">Just for Fun</category></item><item><title>Developing Streaming Pipeline Components - Part 4</title><link>http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/24/developing-streaming-pipeline-components-part-4.aspx</link><pubDate>Thu, 24 Apr 2008 16:58:35 GMT</pubDate><guid isPermaLink="false">4e5c2b59-774a-4189-b009-1bb73818b493:142311</guid><dc:creator>nbarden</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This post I will focus on BizTalk's stream design, and how it allows for the XmlReader and XmlWriter coupling detailed in &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/22/developing-streaming-pipeline-components-part-3.aspx" target="_blank"&gt;Part 3&lt;/a&gt;.&amp;nbsp; Once this topic has been covered, we are finally at a point where all of this background can be applied to achieving actual real world tasks.&amp;nbsp; Yes I know, about time...&lt;/p&gt; &lt;p&gt;This post I will cover the key BizTalk pipeline stream - the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb750427.aspx" target="_blank"&gt;XmlTranslatorStream&lt;/a&gt;, and therefore will be a long post.&amp;nbsp; This post covers what is probably the most crucial details for understanding the whole streaming design.&lt;/p&gt; &lt;p&gt;...&lt;/p&gt; &lt;p&gt;Where I left off in my prior post, I had discussed the issues with needing to be able to chain the XmlReader and XmlWriter together at the right time - to move data through from the inbound stream to the outbound stream on demand.&amp;nbsp; In other words, when someone further down the pipeline from us needs some data to read - this is when we want this movement of data to occur.&amp;nbsp; Also, BizTalk requires that a message part's data is actually a System.IO.Stream type.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Introducing the XmlTranslatorStream&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Instead of trying to re-format what I had already written up for the &lt;a title="Toronto BTUG" href="http://www.btug.biz/Home/Toronto/tabid/80/Default.aspx" target="_blank"&gt;Toronto BTUG&lt;/a&gt; presentation I did on the same topic as this series, I thought I would steal my own slide.&lt;/p&gt; &lt;p&gt;This slide shows the key BizTalk stream when it comes to writing streaming pipeline components - the XmlTranslatorStream, and its relation to the base System.IO.Stream.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/WindowsLiveWriter/DevelopingStreamingPipelineComponentsPar_FCD7/BizTalk%20Stream%20Design_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="350" alt="BizTalk Stream Design" src="http://www.objectsharp.com/cs/blogs/nbarden/WindowsLiveWriter/DevelopingStreamingPipelineComponentsPar_FCD7/BizTalk%20Stream%20Design_thumb.jpg" width="500" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;As you can see, the XmlTranslatorStream has a number of parent classes in the inheritance hierarchy, and at each layer a piece of functionality is added.&amp;nbsp; I will go into the specifics of what occurs in each level later in this post, and how it is implemented internally.&amp;nbsp; The end result is that the XmlTranslatorStream can be provided with an XmlReader as its source of data, and when the XmlTranslatorStream is read it internally chains the reader's data through to an XmlWriter - resulting in an output from the XmlTranslatorStream that is identical to the inbound stream that the XmlReader is reading.&lt;/p&gt; &lt;p&gt;To put this in relation to BizTalk pipelines, this means that in a pipeline component we can now:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Attach an XmlReader to the inbound message's data stream  &lt;li&gt;Create a new XmlTranslatorStream, and provide it with the XmlReader we created  &lt;li&gt;Set the XmlTranslatorStream to the outbound message's data stream&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This does not explain how our custom logic is going to be performed.&amp;nbsp; I will go into this in a future post, but it usually involves passing a custom XmlReader to the XmlTranslatorStream, or deriving from XmlTranslatorStream and overriding the functionality it provides.&lt;/p&gt; &lt;p&gt;Once the next component in the pipeline gets a reference to its inbound message's data, it is going to be a reference to the XmlTranslatorStream that we set in the prior component.&amp;nbsp; This component, and all other components in the pipeline perform the steps in the bullet points.&amp;nbsp; Note that this is for general cases - I'm sure there are many cases where other steps will need to be performed in the pipeline component's main method.&lt;/p&gt; &lt;p&gt;Therefore, at the end of the pipeline when all pipeline components have been called by BizTalk (but no data has been read yet), we have a stream structure like is depicted in the following slide:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/WindowsLiveWriter/DevelopingStreamingPipelineComponentsPar_FCD7/Wrapped%20Streams_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="350" alt="Wrapped Streams" src="http://www.objectsharp.com/cs/blogs/nbarden/WindowsLiveWriter/DevelopingStreamingPipelineComponentsPar_FCD7/Wrapped%20Streams_thumb.jpg" width="500" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;This slide attempts to show that we end up with a series of layered streams.&amp;nbsp; This is for a receive pipeline, and it shows (from inner circle to outer):&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A FileStream representing the message received by the file adapter (this isn't actually the type of stream the adapter gives us, but it's one that everyone is familiar with)  &lt;li&gt;An XmlDasmStreamWrapper which is returned by the BizTalk XML Disassembler component  &lt;li&gt;An XmlValidatingStream which is returned by the BizTalk XML Validator component  &lt;li&gt;An XmlTranslatorStream returned by a custom pipeline component  &lt;li&gt;Also, note that each inner layer of stream is "attached" to the next outer layer by the technique I discussed earlier.&amp;nbsp; That is, the outer stream contains an XmlReader which is reading over the inner stream as its source of data  &lt;li&gt;Note that XmlDasmStreamWrapper and XmlValidatingStream both derive from XmlTranslatorStream, and therefore follow the same pattern as it&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Now if you refer back to the "Streaming - Processing Execution Order" slide from &lt;a href="http://www.objectsharp.com/cs/blogs/nbarden/archive/2008/04/17/developing-streaming-pipeline-components-part-2.aspx" target="_blank"&gt;Part 2&lt;/a&gt;, and the description I gave for how it executes, things should hopefully be starting to fall into place about how all of this operates.&amp;nbsp; Now when BizTalk starts reading the stream provided by the last component in the pipeline (represented by the blue circle in the above slide), this stream has no data to provide to the read request.&amp;nbsp; As a result, it reads from its internal XmlReader.&amp;nbsp; When the read method returns, it will push the data into its internal XmlWriter, and the data that the XmlWriter generates will then be given to the stream that requested the data.&amp;nbsp; But calling read on the outermost XmlReader in the chain will cause a number of calls before it returns...&lt;/p&gt; &lt;p&gt;You will notice that the only stream that has a physical backing store is the innermost FileStream.&amp;nbsp; All other streams are simply a wrapper around another stream.&amp;nbsp; Therefore, as each stream is read, it has no data to provide, so it spins its XmlReader, pulling data from the stream it is wrapping.&amp;nbsp; This in turn does the same thing until the read request makes it all the way into the innermost FileStream, which fulfils the read request as it actually has data to provide.&amp;nbsp; The call then propagates back down the stack, providing the data to the wrapping streams until it makes it all the way back to the outer stream and data is returned to BizTalk.&lt;/p&gt; &lt;p&gt;So far, in order to make it easier to understand where the XmlTranslatorStream fits in in the big picture and to be able to apply it to something developers can related to earlier rather than later, I have skipped goin