<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DonXML Blog : XML</title><link>http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx</link><description>Tags: XML</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Announcing the NJ SQL Server User Group </title><link>http://weblogs.asp.net/donxml/archive/2005/11/21/431069.aspx</link><pubDate>Mon, 21 Nov 2005 15:05:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:431069</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;It has been a long time coming, but NJ will finally see the return of a SQL Server User Group.&amp;nbsp; I’ve been trying to get this group going for about a year now, and the biggest hang-ups has been trying to get a location, and finding volunteers to help run the group.&amp;nbsp; Well, we solved both issues with the help of the great folks at &lt;a href="http://www.setfocus.com/"&gt;SetFocus &lt;/a&gt;(who run the Northern NJ .Net User Group &lt;a href="http://www.n3ug.org/" target="_blank"&gt;N3UG&lt;/a&gt;).&amp;nbsp; My wife, Melissa (aka &lt;a href="http://www.sqldiva.com/"&gt;SQL Diva&lt;/a&gt;), is going to run the user group, and SetFocus will let us hold the meetings in their facility in Parsippany, NJ (which is very close to where I live,&amp;nbsp;and makes it possible for Melissa to run the group).&amp;nbsp; The meeting will be held the 3rd Tues. of the month (a week after the .Net User Group), and will start on&amp;nbsp; Jan. 17th.&amp;nbsp; Informal networking begins at 6PM and the presentation starts at 6:30 (until about 8PM).&lt;/p&gt; &lt;p&gt;This SQL group will not be like most other SQL groups, as it is dedicated to the Data Tier Developer (sprocs, integration services (aka DTS), Analysis Services (aka OLAP), Reporting Service, etc.)&amp;nbsp;, and will not contain presentations relavent to the Support DBA (back-up, recovery, etc.).&amp;nbsp; The user group will join both &lt;a href="http://www.sqlpass.org/" target="_blank"&gt;PASS&lt;/a&gt;, and &lt;a href="http://www.ineta.org/DesktopDefault.aspx" target="_blank"&gt;INETA&lt;/a&gt;, and we plan on taking advantage of the &lt;a href="http://www.ineta.org/DesktopDefault.aspx?tabindex=2&amp;amp;tabid=14"&gt;INETA Speaker’s Bureau&lt;/a&gt;.&amp;nbsp; I’m going to be doing the first presentation, Intro SQL Server 2005.&amp;nbsp; If you are interested in presenting, please contact Melissa, via the website &lt;a href="http://www.njsql.org/"&gt;www.njsql.org&lt;/a&gt;&amp;nbsp;or her website, &lt;a href="http://www.sqldiva.com/"&gt;www.sqldiva.com&lt;/a&gt;.&amp;nbsp; The NJ SQL site isn’t 100% complete.&amp;nbsp; I’ve still got a lot of skinning of &lt;a href="http://www,communityserver.org/" target="_blank"&gt;CommunityServer &lt;/a&gt;to do, and we have a lot more content to put up, but we wanted to let everyone know about the group, ASAP.&lt;/p&gt; &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;Don Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2005/11/21/2288.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&lt;/font&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=431069" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>XML Tools I’d Like To See Built For Visual Studio.Net</title><link>http://weblogs.asp.net/donxml/archive/2004/12/16/323154.aspx</link><pubDate>Fri, 17 Dec 2004 02:46:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:323154</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;While at this year’s &lt;a href="http://www.sellsbrothers.com/conference/"&gt;XMLDevCon &lt;/a&gt;I came up with 2 VS.Net add-ins that I’d wanted to write and release as open source for .Net.&amp;nbsp; I was withholding the ideas figuring that I would find time to write them, but it has been a couple months and I haven’t even begun work on them.&amp;nbsp; So, I’ll publish them here, and hopefully someone else will help take up the gauntlet. &lt;/p&gt; &lt;p&gt;In .Net 2.0, XSLT will compile down to IL (and you can debug it in VS.Net).&amp;nbsp; The add-in I’d like to see is one that would let you compile your XSLT right into your .Net project and not need (a) separate XSLT file(s).&amp;nbsp; Yes, I know that you may not want this in all circumstances, but there are a lot of times that my XSLT is pretty much static.&amp;nbsp; I’ll pass in parameters, just like any XSLT, but isn’t a shame that I have to always treat XSLT like a resource file, and have to do all this compiling and caching on the fly.&amp;nbsp; Wouldn’t it be cool to just compile it into your project when you wanted it?&amp;nbsp; An extension of this idea would not to just include the IL in your project, but use something like &lt;a href="http://www.aisto.com/roeder/dotnet/Download.aspx?File=Reflector"&gt;Lutz Roeder’s Reflector &lt;/a&gt;to generate your favorite .Net language and make that part of your project (effectively making XSLT a code generation language within .Net).&amp;nbsp; Some things are just easier to write in XSLT.&lt;/p&gt; &lt;p&gt;The other add-in is really just an extension of the XSLT idea, and that is to do the same thing for XML Schema.&amp;nbsp; Why does the XML schemas always have to be a separate file, and dynamically “compiled” and used.&amp;nbsp; Actually, compiling XML Schema down to IL, and including it in a project would probably be used more often then someone would use the XSLT add-in.&amp;nbsp; And, if we use Reflector, you could even add some validation rules that couldn’t be done well in XML Schema (think Schematron).&amp;nbsp; I guess that would turn XML Schema into a code generation tool, but I don’t think that is so bad.&lt;br /&gt;&lt;/p&gt; &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/12/16/1594.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&lt;/font&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=323154" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>Do We Love XSLT Because It Is Difficult To Learn?</title><link>http://weblogs.asp.net/donxml/archive/2004/12/12/280910.aspx</link><pubDate>Mon, 13 Dec 2004 01:06:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:280910</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;M. David (on his &lt;a href="http://www.xsltblog.com/"&gt;XSLTBlog&lt;/a&gt;)&amp;nbsp;asks why some of us are &lt;a href="http://www.xsltblog.com/archives/2004/12/could_it_be_tha.html"&gt;drawn to XSLT &lt;/a&gt;and has a great quote (well sort of quote) from &lt;a href="http://www.tbray.org/ongoing/"&gt;Tim Bray &lt;/a&gt;from a late night drinking session at XMLDevCon:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;to understand XSLT you must first reach up with both hands and grab the two halves of your brain peeling each back until you have successfully turned your brain completely inside out&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;M. David thinks that it is just because XSLT is hard to learn, and we love to torture ourselves.&amp;nbsp; Me, well I think that some of us realize (in the deep dark recesses of our brains) that procedural programming (aka what most people call programming) is preventing us from reaching out full potential and that some form of declarative programming is the future.&amp;nbsp; XSLT reminds us that there is more then just procedural programming out there, and we really have to stop and open our minds to other forms of programming.&amp;nbsp; I think that once we get beyond the coding everything procedurally mentality, we will finally be able to develop systems that actually learn, and are not just programmed (&lt;a href="http://www.martinfowler.com/bliki/DomainSpecificLanguage.html"&gt;Domain Specific Langauges&amp;nbsp;&lt;/a&gt;&amp;nbsp;hint at just the beginning of our trip down that path).&lt;br /&gt;&lt;/p&gt; &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/12/12/1587.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&lt;/font&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=280910" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>Not the Way to Introduce XmlTextReader</title><link>http://weblogs.asp.net/donxml/archive/2004/11/29/272025.aspx</link><pubDate>Tue, 30 Nov 2004 02:59:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:272025</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;Thom Robbins is a great guy, but unfortunately for him he has bumped into one of my major pet peeves, &lt;a href="http://donxml.com/allthingstechie/archive/2004/10/21/1449.aspx"&gt;Viral Coding Examples&lt;/a&gt; with his &lt;A href="http://weblogs.asp.net/trobbins/archive/2004/11/29/271962.aspx"&gt;Introducing the XmlTextReader&lt;/a&gt; post.&amp;nbsp; It really isn’t his fault, since the code he uses is very similar to the code example in the XmlTextReader.Read()&amp;nbsp; &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxmltextreaderclassreadtopic.asp"&gt;documentation&lt;/a&gt;, and I complained about that code to the System.Xml team at the MVP Summit.&amp;nbsp; I did promise to write something up on it, and Thom’s post finally got me to do it (it has been months since I promised to write this up).&lt;/p&gt; &lt;p&gt;The problem is in the structure of the code:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;Dim xmlFileStream As New FileStream("cust.xml", FileMode.Open)&lt;br /&gt;Dim xmlRead As New XmlTextReader(xmlFileStream)&lt;/p&gt; &lt;p&gt;While xmlRead.Read&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlRead.MoveToContent()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If xmlRead.HasValue Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(xmlRead.Value)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;End While&lt;/p&gt; &lt;p&gt;xmlRead.Close()&lt;/p&gt; &lt;p&gt;xmlFileStream.Close()&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;At first glance the code looks perfectly fine.&amp;nbsp; But, knowing full well that some developer new to System.Xml will be using this code as a template for bigger things we have an obligation to make it easier for them to adapt this code without causing “strange” errors.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;u&gt;Problem #1&lt;/u&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;No explicit setting of the WhitespaceHandling option&lt;/strong&gt;.&amp;nbsp; Unless the developer is familiar with XmlTextReader (which shouldn't be in this case), they would not know that the default is WhitespaceHandling.All, which causes the reader to return all Whitespace and SignificantWhitespace nodes (which will definitely confuse the developer).&amp;nbsp; So after the declaration of the xmlRead variable you should set the WhitespaceHandling property.&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;xmlRead.WhitespaceHandling = WhitespaceHandling.None&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;At least now the developer realizes that there is a property for WhitespaceHandling, and will/can change it as needed.&lt;/p&gt; &lt;p&gt;&lt;u&gt;Problem #2&lt;/u&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Implicit Control of Reads in While Loops.&lt;/strong&gt;&amp;nbsp; My biggest problem with the code examples used to XmlTextReader has to do with the While xmlRead.Read loops.&amp;nbsp; Although it looks very harmless, the while loop that executes a read at the beginning (or the end) of a looping structure will cause bugs to creep into the code because of the way other methods on the XmlTextReader handle the cursor used to point to the current node.&amp;nbsp; If all you do is execute Reads via the while loop, you are perfectly fine.&amp;nbsp; But once you add code that manipulates the cursor from within the while loop, now you run the chance of skipping nodes accidentally. &lt;/p&gt; &lt;p&gt;Here’s a great example.&amp;nbsp; You have an XML stream that looks like this:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;&amp;lt;ROOT&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;LEVEL1&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;LEVEL2&amp;gt;1st Level2 text node&amp;lt;/LEVEL2&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;LEVEL2&amp;gt;2nd Level2 text node &amp;lt;/LEVEL2&amp;gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;lt;/LEVEL1&amp;gt;&lt;br /&gt;&amp;lt;/ROOT&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;And you want to print out the contents of the elements level2, so you modify the standard code example to look like this:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;While xmlRead.Read&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlRead.MoveToContent()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If xmlRead.IsStartElement() then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If xmlReader.Name = “level2” then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(xmlRead.ReadInnerXml())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;End While&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;And you know what, it works fine.&amp;nbsp; But say the XML stream does not have all that pretty whitespace, or that they took my advice and set the WhitespaceHandling property (in this case to None).&amp;nbsp; Now the code doesn’t work, since you had a bug in your code and you didn’t know it.&amp;nbsp; What?&amp;nbsp; How is that?&amp;nbsp; Well, the ReadInnerXml method reads to the first node past the EndElement.&amp;nbsp; In the case of the XML Stream with the nice formatting (and when WhitespaceHandling is All) the next node is a whitespace node, and when the while loop fires the Read method, all is well and the cursor is moved to the next Node (which should be the next StartElement, otherwise the MoveToContent method will move you to the next content node (which is any node that is non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity)).&amp;nbsp; But without the whitespace nodes to stop the ReadInnerXml method the cursor is positioned at the next non whitespace node (which in this case is the StartElement for level2) and then the while loop fires the Read method, and when we enter the loop we have now read past the StartElement and the if condition is not met (and we skip the whole element).&lt;/p&gt; &lt;p&gt;So, what is a better example for an introduction to the XmlTextReader?&amp;nbsp; Explicitly control when a Read is executed.&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;XmlRead.WhitespaceHandling = WhitespaceHandling.None&lt;br /&gt;Dim Continue as Boolean&lt;br /&gt;If xmlRead.Read = False then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Continue = False&lt;br /&gt;End If&lt;br /&gt;While Continue&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If xmlRead.IsStartElement then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If xmlRead.Name = “level2” then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(xmlRead.ReadInnerXml())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Continue = xmlRead.Read()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Continue = xmlRead.Read()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;End While&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now we have explicit control over when a Read is executed, and in the case of rogue methods that place your cursor to the next node (that you haven’t tested yet), you can skip the implicit Read.&lt;/p&gt; &lt;p&gt;If you want, you can download a fully functional &lt;a href="http://www.donxml.com/SourceCode/XmlReaderExamples.zip"&gt;example &lt;/a&gt;with 5 different test cases.&lt;br /&gt;&lt;/p&gt; &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/11/29/1554.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&lt;/font&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=272025" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>Viral Coding Examples in Presentations</title><link>http://weblogs.asp.net/donxml/archive/2004/10/21/245981.aspx</link><pubDate>Thu, 21 Oct 2004 21:49:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:245981</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>1</slash:comments><description>&lt;p&gt;Joe Fawcett (fellow XML MVP) came across a great &lt;a href="http://groups.google.com/groups?hl=en&amp;amp;lr=&amp;amp;threadm=reddymade.1ecp2s%40mail.codecomments.com&amp;amp;rnum=1&amp;amp;prev=/groups%3Fq%3DIs%2Bit%2Bpossible%2Bto%2Bmodify%2BXML%2Bfile%2Bdirectly%2Bwithout%2Busing%2BDataset%2522%26hl%3Den%26lr%3D%26selm%3Dreddymade.1ecp2s%2540m"&gt;example &lt;/a&gt;(from the Microsoft.Public.Xml newsgroup) of one of my biggest pet peeves, “We (the community) are doing a very poor job teaching the average developer how to use XML properly in .Net”.&amp;nbsp; &lt;/p&gt; &lt;p&gt;I want to draw your attention to a line from the original post:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;“So, is it possible to directly modify the xml file instead of using the dataset.”&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;And the first response was:&lt;/p&gt; &lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt; &lt;p&gt;“you can do it using Data Island”&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Why does thing question bug me so much?&amp;nbsp; Because we (the community) have done a very bad job using XML correctly in our articles and presentations.&amp;nbsp; The reason why Joe pinged me with this example is because I went on a rant earlier this year (in a private conversation) how disappointed I was in one of the DevDays presentations.&amp;nbsp; In the presentation, they were trying to show some cool Whidbey WinForm stuff, and the example went something like this: “We have this XML file and we want to display the info it in a WinForm, so let’s use a DataSet to open the XML file and then bind it to the controls on the form”.&amp;nbsp;&amp;nbsp; NOOOOO my mind went.&amp;nbsp; This is not the way to introduce developers to XML.&amp;nbsp; Yes, can you open an XML with a dataset, and yes it is quick and easy to do, but it is enforcing very bad development practices, which lead to questions like Joe found.&amp;nbsp; People learn new technologies from these examples, and we really have to be careful when writing them. &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/10/21/1449.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=245981" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>NJ Dev Dinner 9/14/2004 – Special Edition </title><link>http://weblogs.asp.net/donxml/archive/2004/09/13/228924.aspx</link><pubDate>Mon, 13 Sep 2004 18:31:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:228924</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;Right after the &lt;a href="http://www.n3ug.org/"&gt;N3UG &lt;/a&gt;meeting (with Dave Douglass’ presentation on Generics), we will have a special edition of the NJ Dev Dinner.&amp;nbsp; What’s the occasion?&amp;nbsp; Microsoft Developer Evangelist &lt;A href="http://weblogs.asp.net/kaevans"&gt;Kirk Allen Evans &lt;/a&gt;is coming up from Atlanta, GA, and will be in the area.&amp;nbsp; After the meeting we will move on over to Chevy’s for some fun, food, and drink. &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/09/13/1322.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=228924" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>A Suggestion for the Microsoft Careers Site</title><link>http://weblogs.asp.net/donxml/archive/2004/09/01/223957.aspx</link><pubDate>Wed, 01 Sep 2004 14:43:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:223957</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;I was on the Microsoft Technical Recruiting Chat last night (I’m not really looking, just snooping around), when I remembered a comment made by either &lt;A href="http://weblogs.asp.net/jobsblog"&gt;Zoë or Gretchen &lt;/a&gt;(I can’t remember who, or even find it) about making sure that your resume looked good in plain text when submitting it via their site.&amp;nbsp; They don’t take resumes in Word format (or even HTML), and you can either paste vanilla text into a free form input box, or use the resume builder.&amp;nbsp; They mentioned that as an applicant, you should make sure the plain text version of your resume is easy to read, and not just a Word doc saved as text (which would be very hard on the eyes).&amp;nbsp;&amp;nbsp; At the time I read that, I thought it was a good tidbit, so I filed it away for future reference.&amp;nbsp; During the chat something clicked, and I remembered that Microsoft had released an &lt;a href="http://www.microsoft.com/technet/itsolutions/techguide/mso/recruit/default.mspx"&gt;Office Solution Accelerator for Recruiting&lt;/a&gt;, which includes a nice &lt;a href="http://www.microsoft.com/technet/itsolutions/techguide/mso/recruit/rbbtg/default.mspx"&gt;resume builder section&lt;/a&gt;.&amp;nbsp; The resume builder includes an InfoPath Resume Form (which uses the &lt;a href="http://www.hr-xml.org/channels/home.htm"&gt;HR-XML&lt;/a&gt; schema for resumes), and a complementing resume submittal web service.&amp;nbsp; Shouldn’t Microsoft recruiting IT department do a little dogfooding, and be using this?&amp;nbsp; It is definitely better than submitting a text version of a resume, and trying to shred the document.&amp;nbsp; Plus, since it is an XML document, they could easily apply an XSL (either XSLT to WordML or XSL-FO to PDF) and transform the resume into an easy to read format for the recruiters.&amp;nbsp; I know that everyone does not have InfoPath (but it is an excellent tool), so they would have to create an alternate means to creating an XML version of the resume (can we say open source project?), and still maintain the good old text box input method for the less technical folks applying to Microsoft.&amp;nbsp; It sounds to me like there would be a decent return on investment for this type of thing, with Microsoft hiring some 7000 people this year. &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/09/01/1267.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&lt;font color="#000080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/font&gt; &lt;p&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=223957" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>DataMapper Performance Statistics On VS2005 Beta 1 and SQL Server 2005 Beta2</title><link>http://weblogs.asp.net/donxml/archive/2004/08/09/211300.aspx</link><pubDate>Mon, 09 Aug 2004 15:15:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:211300</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;p&gt;I took the code from my &lt;a href="http://www.donxml.com/allthingstechie/archive/2004/06/25/862.aspx"&gt;previous DataMapper examples&lt;/a&gt;, which was written for .Net 1.1 and SQL2K, and ported it to VS2005 Beta 1 with SQL Server 2K5.&amp;nbsp; I did not have to change one line of code in either the sprocs or in the 1.1 C# code (great going VS &amp;amp; SQL team).&amp;nbsp; Since my example code also used the DAAB 3.1, I decided to port that too, with no issues.&amp;nbsp; Since I was going to be testing the beta versions running in VPC, I new that I would not be able to compare my original stats to the new stats.&amp;nbsp; But since what I’m really after was performance differences versus a baseline of the DataReader, and comparing those numbers, running on a host OS versus a VPC OS should not be a factor (as long as the OS is the same, which it was, Windows XP).&lt;/p&gt; &lt;p&gt;So let’s look at the numbers.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;The original stats (using .Net 1.1)&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt; &lt;table border="1"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;DataReader&lt;/td&gt; &lt;td&gt;341&lt;/td&gt; &lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;DataSet &lt;/td&gt; &lt;td&gt;411 &lt;/td&gt; &lt;td&gt;21% &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Xpath &lt;/td&gt; &lt;td&gt;450 &lt;/td&gt; &lt;td&gt;32% &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;XmlSerialization &lt;/td&gt; &lt;td&gt;542 &lt;/td&gt; &lt;td&gt;59% &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Using .Net 2.0 beta 1 with SQL Server 2K5 Beta 2&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; &lt;table border="1"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;DataReader&lt;/td&gt; &lt;td&gt;1545&lt;/td&gt; &lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;DataSet &lt;/td&gt; &lt;td&gt;1772&lt;/td&gt; &lt;td&gt;15% &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Xpath &lt;/td&gt; &lt;td&gt;1993&lt;/td&gt; &lt;td&gt;29% &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;XmlSerialization &lt;/td&gt; &lt;td&gt;2069&lt;/td&gt; &lt;td&gt;34% &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt; &lt;p&gt;So, when comparing to a 2.0 base of DataReader, the other 3 techniques all picked up their performance (relative to the 1.1 ratios).&amp;nbsp; The biggest gain was in XmlSerialization performance which cut the ratio in half (which makes sense since most of hard lifting is done in the generated code).&amp;nbsp; Now I need to get down and dirty and do 2 things, tweak the .Net code to use 2.0 features (like generics and the new XPathNav) and then tweak the SQL Server sprocs to take advantage of the better SQLXML features.&lt;/p&gt; &lt;p&gt;But overall, considering this is still beta code and not totally performance tuned, these are incredible numbers. &lt;hr id="null" /&gt; &lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color="#000080" size="2"&gt;The preceding blog entry has been syndicated from the &lt;/font&gt;&lt;a href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;font color="#000080" size="2"&gt;DonXML Demsak’s All Things Techie Blog&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Please post all comments on the original &lt;/font&gt;&lt;a href="http://donxml.com/allthingstechie/archive/2004/08/04/1012.aspx"&gt;&lt;font color="#000080" size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font color="#000080" size="2"&gt;.&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=211300" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>Revisiting XML DevCon 2003 – The Videos</title><link>http://weblogs.asp.net/donxml/archive/2004/07/14/183072.aspx</link><pubDate>Wed, 14 Jul 2004 15:49:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:183072</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;P&gt;It is hard to believe, but it has been just over one year since &lt;A href="http://www.sellsbrothers.com/conference/"&gt;XML DevCon 2003&lt;/A&gt;.&amp;nbsp; Because most of the subject mater was pretty ahead of its time for the common enterprise developer, I&amp;#8217;m sure most of the people that read this blog either didn&amp;#8217;t watch the videos on &lt;A href="http://msdn.microsoft.com/msdntv/"&gt;MSDN TV&lt;/A&gt;, or only understood a limited amount of the content.&amp;nbsp; Now with another years worth of experience under your belt, you should take the time to watch them again.&amp;nbsp; I&amp;#8217;ve found lots of little tid bits that I missed the last time.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.gotdotnet.com/team/dbox/"&gt;Don Box&lt;/A&gt; --&amp;nbsp;&lt;EM&gt;SOAP: Service Oriented Architecture and Programming&lt;/EM&gt;, &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030827SOAPDB/manifest.xml"&gt;part 1&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030902SOAPDB/manifest.xml"&gt;part 2&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.pluralsight.com/blogs/tewald/default.aspx"&gt;Tim Ewald&lt;/A&gt; --&amp;nbsp;&lt;EM&gt;Rebuilding MSDN with Angle Brackets&lt;/EM&gt; (real world experiences of XML Schema), &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030916WebServicesTE/manifest.xml"&gt;part 1&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030918WebServicesTE/manifest.xml"&gt;part 2&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.pluralsight.com/blogs/aaron/default.aspx"&gt;Aaron Skonnard&lt;/A&gt; --&amp;nbsp;&lt;EM&gt;Validating Business Rules with XPath Assertions&lt;/EM&gt;, &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20031007XMLAS/manifest.xml"&gt;part 1&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20031016XMLAS/manifest.xml"&gt;part 2&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;HR id=null&gt;
&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT color=#000080 size=2&gt;The preceding blog entry has been syndicated from the &lt;/FONT&gt;&lt;A href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;FONT color=#000080 size=2&gt;DonXML Demsak&amp;#8217;s All Things Techie Blog&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color=#000080 size=2&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Please post all comments on the original &lt;/FONT&gt;&lt;A href="http://donxml.com/allthingstechie/archive/2004/07/14/933.aspx"&gt;&lt;FONT color=#000080 size=2&gt;post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color=#000080 size=2&gt;.&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=183072" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item><item><title>Performance Statistics of Various Implementations of the Data Mapper Pattern </title><link>http://weblogs.asp.net/donxml/archive/2004/06/28/167759.aspx</link><pubDate>Mon, 28 Jun 2004 13:01:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:167759</guid><dc:creator>DonXML</dc:creator><author>DonXML</author><slash:comments>0</slash:comments><description>&lt;P&gt;What started off as a quick how-to example of rehydrating business objects from data access layers (in reply to this &lt;A href="http://dotnetjunkies.com/WebLog/jkimble/archive/2004/05/28/14729.aspx"&gt;Jay Kimble post&lt;/A&gt;) morph&amp;#8217;d into a whole lot more (thanks to &lt;A href="http://www.hanselman.com/blog/PermaLink.aspx?guid=d88f7539-10d8-4697-8c6e-1badb08bb3f5"&gt;Scott Hansleman&amp;#8217;s DataSet post&lt;/A&gt;, and &lt;A href="http://donxml.com/allthingstechie/archive/2004/06/01/762.aspx"&gt;my thoughts on the topic&lt;/A&gt;).&amp;nbsp; The idea was pretty simple.&amp;nbsp; I wanted to see how long it took to rehydrate a multi-dimension object graph from data retrieved from a database using the most common methods in .Net.&amp;nbsp; Going into this project, I had some preconceived notions on what the results would be, but I was very surprised at the results.&lt;/P&gt;
&lt;P&gt;For those of you that are not pattern aware (yet), the process that you go through when converting data to business objects is called a &lt;A href="http://www.martinfowler.com/eaaCatalog/dataMapper.html"&gt;Data Mapper Pattern&lt;/A&gt;.&amp;nbsp; The Data Mapper layer handles the creation of your business objects (aka your domain) from data, and hopefully don&amp;#8217;t even know that there is a database (thanks to the data access layer).&amp;nbsp; In a domain-less (aka no business object) world the mapping step is skipped entirely, and datasets are used, with the business rules all tied up in the presentation tier or down in the database.&amp;nbsp; A slight advancement over the pure dataset method is strongly-type datasets, but unless you modify the generated code, you can not add the business rules into your strongly-typed datasets (at least until .Net 2.0&amp;#8217;s partial classes).&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;In this project, I decided to use the DAAB v3.1 as the basis for my data access layer, since I know that a lot of people use it, and it saves me from have to explain my data access layer (more on that another time).&amp;nbsp; All I did is add my Connection String encryption project to it (keeping it a more enterprise ready example), and added a service layer around the DAAB (to encapsulate the Data Access, and hide it as much as possible from the business objects).&lt;/P&gt;
&lt;P&gt;For the actual data mapping, that code is actually only dependent on one thing, how you exposing the data to the data mapper code.&amp;nbsp; There are three popular ways to pass data from the data access layer to the layers above, the DataReader, the DataSet, and the XmlReader.&amp;nbsp; Both the DataReader and the DataSet require you to create the actual data mapping code by hand, but with the XmlReader, you can use Xml Serialization to deserialize the XML into an instance of your business objects.&amp;nbsp; There is one more way that I&amp;#8217;ve been working on to pass data up from the data access layer, and that is by using XPathNavigators, so I added this as a fourth example.&amp;nbsp; This is the one implementation that I was most interested in finding out the performance figures for.&lt;/P&gt;
&lt;P&gt;The sample database I used was the all too familiar Northwind database on SQL Server 2000 (with all the latest service packs).&amp;nbsp; I created a cloned copy of the database and created the following stored procedure to test against (well actually there are 2 versions of the stored proc, one &amp;#8220;normal&amp;#8221; proc, and one that returned an XML stream using the For Xml Auto clause) that would return all the employees, with their associated Territories, and the Region for the Territory. &lt;/P&gt;
&lt;P&gt;SELECT &amp;nbsp;Employee.EmployeeId as "Employee.Id",&lt;BR&gt;&amp;nbsp;Employee.LastName as "Employee.LastName",&lt;BR&gt;&amp;nbsp;Employee.FirstName as "Employee.FirstName",&lt;BR&gt;&amp;nbsp;Employee.Title as "Employee.Title",&lt;BR&gt;&amp;nbsp;Employee.BirthDate as "Employee.BirthDate",&lt;BR&gt;&amp;nbsp;Territory.TerritoryId as "Territory.Id",&lt;BR&gt;&amp;nbsp;RTRIM(Territory.TerritoryDescription) as "Territory.Description",&lt;BR&gt;&amp;nbsp;Region.RegionID as "Region.Id",&lt;BR&gt;&amp;nbsp;RTRIM(Region.RegionDescription) as "Region.Description"&lt;BR&gt;from dbo.Employees Employee&lt;BR&gt;INNER JOIN dbo.EmployeeTerritories et&lt;BR&gt;on Employee.EmployeeID = et.EmployeeID&lt;BR&gt;INNER JOIN dbo.Territories Territory&lt;BR&gt;on et.TerritoryID = Territory.TerritoryID&lt;BR&gt;INNER Join dbo.Region Region&lt;BR&gt;on Region.RegionID = Territory.RegionID&lt;BR&gt;order by Employee.EmployeeID, Territory.TerritoryId, Region.RegionId;&lt;/P&gt;
&lt;P&gt;This would give me a nice 3 dimensional object graph to test the performance numbers against.&amp;nbsp; If you want to see all the code, &lt;A href="http://www.donxml.com/mvp.xml.datamappers.zip"&gt;you can pull it down from here&lt;/A&gt;&amp;nbsp; (Or you can get the code from the &lt;A href="http://sourceforge.net/projects/mvp-xml/"&gt;Mvp.Xml SourceForge Project&lt;/A&gt;).&amp;nbsp; Just add the stored procs to a version of Northwind, and compile and walk thru the code (until I can get some time to write this all up in a series of articles).&lt;/P&gt;
&lt;P&gt;Now, on to the results.&amp;nbsp; I used my Dell 8500 laptop as the test machine, with WindowsXP SP2, VS.Net 2k3, and SQL2k.&amp;nbsp; I wrote a small console app for each of the 4 test cases and they all used the&amp;nbsp;&lt;A href="http://www.codeproject.com/csharp/highperformancetimercshar.asp"&gt;High Performance Timer &lt;/A&gt;code to get better time measurements.&amp;nbsp; In order to try to get more consistent results, the console app will load the business object one time (to get everything compiled and into memory, including connection and all the SQL Server side stuff), and then start the timer and loop thru 1000 times.&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;DataReader - 341&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;DataSet - 411 ( 18.6% slower than the DataReader) &lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;XPathNavigator - 450 (27.7% slower than the DataReader)&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;XmlSerialization - 542 (46.3% slower than the DataReader)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR&gt;It wasn&amp;#8217;t real surprising that the DataReader was the fastest of the implementations, but what surprised me was how slow the XmlSerialization was, and that the XPathNavigator was slower than the DataSet.&amp;nbsp; (oh, and if you are wondering how I calculated the percent changed, see t&lt;A href="http://www.megspace.com/science/sfe/i_ot_pch.html"&gt;his article on why what you were taught in high school was wrong and very misleading&lt;/A&gt;).&amp;nbsp; I went over my code pretty well, but I&amp;#8217;m sure that people will find some performance enhancements, but overall, I&amp;#8217;m pretty sure that things were done pretty consistently, and most enhancements will effect all the results and wash out of the final analysis ( and yes, I made sure that I cached the XmlSerialization instance, so that isn&amp;#8217;t why that implementation method is so slow).&amp;nbsp; But, if you find something, definitely let me know so that I can update it. &lt;/P&gt;
&lt;P&gt;I&amp;#8217;m sure there are lots of other ways to implement a DataMapper in .Net.&amp;nbsp; You are welcome to clone the code, implement it, and let us know what your results were.
&lt;HR id=null&gt;
&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT color=#000080 size=2&gt;The preceding blog entry has been syndicated from the &lt;/FONT&gt;&lt;A href="http://www.donxml.com/AllThingsTechie/default.aspx"&gt;&lt;FONT color=#000080 size=2&gt;DonXML Demsak&amp;#8217;s All Things Techie Blog&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color=#000080 size=2&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Please post all comments on the original &lt;/FONT&gt;&lt;A href="http://donxml.com/allthingstechie/archive/2004/06/25/862.aspx"&gt;&lt;FONT color=#000080 size=2&gt;post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT color=#000080 size=2&gt;.&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=167759" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/donxml/archive/tags/.Net/default.aspx">.Net</category><category domain="http://weblogs.asp.net/donxml/archive/tags/XML/default.aspx">XML</category></item></channel></rss>