<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Word TV</title>
	<atom:link href="http://www.matthewsposato.net/Index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.matthewsposato.net</link>
	<description>Mostly a software development blog by Matthew Sposato, Charlottesville Virginia</description>
	<lastBuildDate>Thu, 13 May 2010 05:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>.NET Technical Interviews</title>
		<link>http://www.matthewsposato.net/?p=88</link>
		<comments>http://www.matthewsposato.net/?p=88#comments</comments>
		<pubDate>Thu, 13 May 2010 05:37:47 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Interview]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=88</guid>
		<description><![CDATA[In the past year I&#8217;ve participated in several job interviews related to .NET development, both as interviewee and interviewer. Which leads me to write this short list of suggestions. 1. Don&#8217;t ask .NET trivia questions. We all know the .NET framework is huge. Too big for mere mortals to know it entirely. Hence it&#8217;s easy [...]]]></description>
			<content:encoded><![CDATA[<p>In the past year I&#8217;ve participated in several job interviews related to .NET development, both as interviewee and interviewer. Which leads me to write this short list of suggestions.</p>
<p><strong>1.  Don&#8217;t ask .NET trivia questions.</strong><br />
We all know the .NET framework is huge. Too big for mere mortals to know it entirely. Hence it&#8217;s easy to create arcane, esoteric questions about some obscure part of it.  Failure to answer these trivia questions only proves someone doesn&#8217;t know 100% of the framework, which frankly is most developers.</p>
<p><strong>2. Be humble</strong><br />
I feel this applies to both sides of the interview. I&#8217;ve seen interviewers use their position to push around a candidate. It&#8217;s a real turn off, especially to experienced candidates.</p>
<p><strong>3. Don&#8217;t ask the .NET Interview questions posted on Scott Hanselman&#8217;s blog</strong><br />
No disrespect to Scott Hanselman. I like the interview questions he&#8217;s listed (<a href="http://www.hanselman.com/blog/WhatGreatNETDevelopersOughtToKnowMoreNETInterviewQuestions.aspx">here</a> and <a href="http://www.hanselman.com/blog/ASPNETInterviewQuestions.aspx">here</a>). But they&#8217;re a victim of their own success. I&#8217;ve heard them asked in at least half the interviews I&#8217;ve attended since Scott posted that article. Think of questions related to skills and experience listed on the candidates resume.</p>
<p><strong>4. Reply to questions with focused, short and related answers.</strong><br />
I recently interviewed someone who answered each question with a long, rambling and almost irrelevant answer. The less he knew, the more he talked. He start off trying to answer the question and ten minutes later was still going on some unrelated topic. Maybe he was really nervous. I think a good, general rule is to not speak for more than two or three minutes.</p>
<p>Here are a few of the questions I like to ask when I&#8217;m conducting a technical interview. I prefer questions that anyone can answer, from a recent college graduate to an experienced professional. Answers can be short and simple or can lead to in depth discussion.</p>
<p><em>What are your favorite books, websites, magazines, podcasts, conferences etc. related to software development?<br />
</em>Anyone with a passion for creating software can name several sources they use to improve themselves. The ones who can&#8217;t, are, in general, not growing and learning.</p>
<p><em>How does .NET manage memory?</em><br />
Even a beginner should be able to talk about garbage collection and the stack versus the heap. More knowledgeable developers could discuss the various generation heaps, the large object heap, heap promotion, finalizer queue, weak references, GC.Collect, etc. It&#8217;s a question you can use to plumb someone&#8217;s understanding of .NET. For the record, I&#8217;m not an expert and thoroughly enjoy finding someone who thoroughly understands this topic.</p>
<p><em>How can you make a website fast and scalable?</em><br />
I like this question because there are so many different answers. Webpages could designed to have a small footprint on the wire. Someone could discuss the scalability of webforms vs. asp.net MVC. Answers can be specific to webform, e.g.  viewstate and outputcache. The discussion could focus on architecting a site with separation of concerns that allows different layers to be hosted on other servers. Answers can also involve hardware and network designs &#8211; clustering, load balancing, etc. People who have configured web servers can discuss the tradeoffs between compression, caching, memory usage, cpu usage, response size, et. al. </p>
<p>There&#8217;s a few other questions I like, which I&#8217;ll add to this post shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=88</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Foreign Keys and Performance</title>
		<link>http://www.matthewsposato.net/?p=85</link>
		<comments>http://www.matthewsposato.net/?p=85#comments</comments>
		<pubDate>Mon, 28 Dec 2009 16:00:51 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Database Performance]]></category>
		<category><![CDATA[Foreign Keys]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=85</guid>
		<description><![CDATA[I recently had an occasion to research the impact of foreign keys on database performance. My assumption has always been that the benefits of data integrity provided by foreign keys was worth the performance cost. I general I believe this is still a valid assumption. However there are some situations were removing foreign keys or [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had an occasion to research the impact of foreign keys on database performance. My assumption has always been that the benefits of data integrity provided by foreign keys was worth the performance cost. I general I believe this is still a valid assumption. However there are some situations were removing foreign keys or adding a NO CHECK option would make sense. For example, where IUD operations vastly outnumber read operations. In my experience this is rare. Usually joins and selects happen far more frequently. Obviously a profiling tool is necessary to make an informed decision. Also consider the end user&#8217;s expectations. Do they automatically expect an IUD operation to take longer than a read operation.</p>
<p>Since foreign keys are strictly for data integrity and not performance, I&#8217;ve made the assumption that foreign keys are also indexed. In a nutshell here are the advantages / disadvantages of foreign keys.</p>
<p>Advantages:</p>
<ul>
<li>Referential Integrity – aka no orphaned rows.</li>
<li>FKs provide big hints to SQL Server’s query optimizer and to DB statistics, both of which lead to better performance.</li>
<li>FKs give structure to the data, literally they are the relations in relational databases. In turn, this allows ORMs and visualization tools to see the structure of the database.</li>
</ul>
<p>Disadvantages:</p>
<ul>
<li>Consistency must be checked on every insert, update and delete (IUD).</li>
<li>The index the index must be updated on IUD</li>
<li>Data has to inserted and deleted in a certain order.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=85</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile: Misconceptions, Definition and Perspective</title>
		<link>http://www.matthewsposato.net/?p=72</link>
		<comments>http://www.matthewsposato.net/?p=72#comments</comments>
		<pubDate>Tue, 08 Dec 2009 21:54:01 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Miscelleanous]]></category>
		<category><![CDATA[Pragmatic Programming]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=72</guid>
		<description><![CDATA[Agile is a means to an end. That end, of course, is better software. Software that meets the customer’s needs and is reliable, maintainable, secure, etc. The end game is not to be Agile, but to create better software.]]></description>
			<content:encoded><![CDATA[<p>It’s unfortunate, but in my experience, Agile development is closely following the <a href="http://www.gartner.com/pages/story.php.id.8795.s.8.jsp">Gartner Hype Cycle</a>. Furthermore, I’d guess that many teams are currently in the “Trough of Disillusionment”, perhaps considering Agile another overused buzzword in an industry full of buzzwords. In this post, I enumerate some common Agile misconceptions and, hopefully, offer a more reasonable perspective.</p>
<p><strong>Agile Misconceptions</strong></p>
<p>A common misconception is that Agile is a software development methodology. It’s a reasonable statement, and the sentiment is accurate. However Agile itself lacks the detail of a methodology. The Scrum methodology is most associated with Agile and seems to align itself with the principles of Agile, frequent, short iterations, collaboration, etc.</p>
<p>In recent experiences I have heard Agile defined as a particular development practice. For example, Agile is working in short iterations or Agile is automated testing. Again, there’s a nugget of truth here, but the answer is incomplete.</p>
<p>Other misguided perceptions are that Agile applies only to the IT department or that Agile is easy or at least easier. Clearly the former ignores Agile’s emphasis on collaboration and interaction.  Concerning the latter, Agile helps remove obstacles to better software, but does not involve less effort. I feel Agile often highlights weaknesses, like poor communication skills, or lack of commitment by the business. And those can be hard to fix.</p>
<p><strong>Defining Agile</strong></p>
<p>At a really abstract level, Agile is a philosophy. But I find it hard to sell a philosophy to management. So I use the definition is that Agile is a set of practices that embody the <a href="http://agilemanifesto.org/">Agile Manifesto</a>[1].  If you’re trying to sneak Agile into your shop, which I currently am trying to do, describe it a set of practices that follow the concepts of integrate, inspect and adapt. Senior management may especially appreciate the inspect and adapt part. I envision the Agile principles and practices being organized as follows[2]:</p>
<p><strong>1. Individuals and interactions </strong>over processes and tools</p>
<ul>
<li>Face to Face Communication</li>
<li>Code Reviews</li>
<li>Pair Programming</li>
<li>Close Proximity</li>
<li>Mentoring</li>
</ul>
<p><strong>2. Working software </strong>over comprehensive documentation</p>
<ul>
<li>Test Driven Development</li>
<li>Continuous Integration</li>
<li>Unit Testing</li>
<li>Frequent Releases / Short Iterations</li>
</ul>
<p><strong>3. Customer collaboration </strong>over contract negotiation</p>
<ul>
<li>Daily Meetings</li>
<li>Face to Face Communication</li>
<li>Close Proximity</li>
</ul>
<p><strong>4. Responding to change </strong>over following a plan</p>
<ul>
<li>Frequent Releases / Short Iterations</li>
<li>Continuous Improvement</li>
</ul>
<p>The figure below is a visualization of the above list.</p>
<p><a href="http://www.matthewsposato.net/wp-content/uploads/2009/12/AgilePyramid.png"><img src="http://www.matthewsposato.net/wp-content/uploads/2009/12/AgilePyramid-150x150.png" alt="Visualization of Agile Manifesto and Practices" title="Visualization of Agile Manifesto and Practices" width="150" height="150" class="alignnone size-thumbnail wp-image-73" /></a></p>
<p>The ideas of maximizing simplicity and self organizing teams need to fit in somewhere. I just haven’t figured out which principles they best embody.</p>
<p>I suppose any development methodology could be used with Agile, but, for me at least, the <a href="http://scrummethodology.com/">Scrum Methodology</a> best compliments Agile.</p>
<p><strong>Agile In Perspective</strong></p>
<p>Agile is a means to an end. That end, of course, is better software. Software that meets the customer’s needs and is reliable, maintainable, secure, etc. The end game is not to be Agile, but to create better software.</p>
<p>When Agile was conceived in 2001, it was in response to rigid, structured methodologies that emphasized documents, specific roles for people, well defined phases, milestones, etc. These methodologies seemed generally inconsistent with how software was actually created, or should be created. Nor did these methodologies embrace change, a reality in most line of business applications.</p>
<p>Eight years after conception, many places would not call themselves Agile. However I would venture to guess that many of those places have adopted Agile practices, for example unit tests, or shorter releases. If Agile isn’t mainstream, many of its practices are.</p>
<p>Most of what I’ve discussed thus far is at the project level. For developers, many Agile practices existed before Agile. Two years prior to signing the Agile Manifesto, Andrew Hunt and David Thomas wrote <a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X">The Pragmatic Programmer</a>.   Many of the practices they discussed would now be called Agile practices. To find out more about Agile developer practices I would direct you to either <a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X">The Pragmatic Programmer</a> or <a href="http://pragprog.com/titles/pad/practices-of-an-agile-developer">Practices of an Agile Developer</a>.</p>
<hr size="1" />[1] I wish the Communists didn’t have a manifesto. To me, it ruined the word.</p>
<p>[2] The numbered items are from the Agile Manifesto. The bulleted items are practices that support the concept.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=72</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using ValidationGroups in Dynamic Data Prior to .NET 4.0</title>
		<link>http://www.matthewsposato.net/?p=62</link>
		<comments>http://www.matthewsposato.net/?p=62#comments</comments>
		<pubDate>Thu, 03 Dec 2009 11:53:13 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Dynamic Data]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ValidationGroup]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=62</guid>
		<description><![CDATA[In ASP.NET webform pages, validation groups create sets of controls that are validated separately from other controls. For example, on the same page, one set of controls could be validated when inserting a new product, while a separate group of controls are validated when searching for a product. More information is available here. The current [...]]]></description>
			<content:encoded><![CDATA[<p>In ASP.NET webform pages, validation groups create sets of controls that are validated separately from other controls. For example, on the same page, one set of controls could be validated when inserting a new product, while a separate group of controls are validated when searching for a product. More information is available <a href="http://msdn.microsoft.com/en-us/library/ms227424.aspx" target="_blank">here</a>.</p>
<p>The current (.NET Framework 3.5 SP1) Dynamic Data controls do not have the ValidationGroup property. This is problematic when there are different sets of DynamicValidator and ValidationSummary controls on the same page. For example, controls for managing products and product subcategories might be on the same page and each set of controls would have validation (required fields, date format, etc.). But without the ValidationGroup property, validation errors in one set of controls would show error messages in both ValidationSummary controls.</p>
<p>Starting with the .NET 4.0 Framework, ValidationGroup will be a property of the Dynamic Data controls. However it is possible to use validation groups without the entire 4.0 framework. Here’s how.</p>
<p>First, download and unzip <a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27026">ASP.NET Dynamic Data Preview 4</a>.</p>
<p>Second, from a Dynamic Data web application remove the existing references to System.ComponentModel.DataAnnotations.dll and System.Web.DynamicData.dll. Then add references to the following assemblies, which are in the  DynamicDataPreview4\DynamicDataVNextSamples\CommonFiles directory.</p>
<ul>
<li>Microsoft.Web.Extensions.dll</li>
<li>System.ComponentModel.DataAnnotations.dll</li>
<li>System.Web.DynamicData.dll</li>
</ul>
<p>You’ll have to decide if the risk of using preview assemblies is worth the benefit of extra functionality. Personally, I’ve had no problems with the preview assemblies and would use them until I upgraded to the 4.0 framework.</p>
<p>Third, you will need to update the version number of the System.Web.DynamicData assembly in  the web.config file. The version number must match the one being referenced. In the system.web/compilation/assemblies node, change</p>
<p>&lt;add assembly=&#8221;System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&#8243;/&gt;</p>
<p>to</p>
<p>&lt;add assembly=&#8221;System.Web.DynamicData, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&#8243;/&gt;</p>
<p>And in the system.web/pages/controls node change</p>
<p>&lt;add tagPrefix=&#8221;asp&#8221; namespace=&#8221;System.Web.DynamicData&#8221; assembly=&#8221;System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&#8243;/&gt;</p>
<p>To</p>
<p>&lt;add tagPrefix=&#8221;asp&#8221; namespace=&#8221;System.Web.DynamicData&#8221; assembly=&#8221;System.Web.DynamicData, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&#8243;/&gt;</p>
<p>Last, add the ValidationGroup property to the Dynamic Controls. Attached to this post is an example page with two sets of Dynamic Data controls. One set is for products, the other for product subcategories. The DynamicField, CommandField, ValidationSummary and DynamicValidator controls are in their respective ValidationGroup, which as expected eliminates cross validation.</p>
<p><a rel="attachment wp-att-65" href="http://www.matthewsposato.net/?attachment_id=65">ListDetails.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=62</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upcoming Presentations</title>
		<link>http://www.matthewsposato.net/?p=56</link>
		<comments>http://www.matthewsposato.net/?p=56#comments</comments>
		<pubDate>Fri, 31 Jul 2009 17:39:29 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Speaking]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=56</guid>
		<description><![CDATA[In the fall I have the privilege of presenting at the following events. October 3rd &#8211; Richmong Code  Camp October 8th &#8211; Roanoke Valley .NET User Group October 15th &#8211; Charlottesville .NET User Group Hope to see y&#8217;all there. Thank You October 3rd &#8211; Richmong Code  Camp October 8th &#8211; Roanoke Valley .NET User Group [...]]]></description>
			<content:encoded><![CDATA[<p>In the fall I have the privilege of presenting at the following events.</p>
<ul>
<li>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">October 3rd &#8211; Richmong Code  Camp</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">October 8th &#8211; Roanoke Valley .NET User Group</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">October 15th &#8211; Charlottesville .NET User Group</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Hope to see y&#8217;all there. Thank You</div>
</li>
<li>October 3rd &#8211; <a href="http://richmondcodecamp.org/" target="_blank">Richmong Code  Camp</a></li>
<li>October 8th &#8211; <a href="http://www.rvnug.org/" target="_blank">Roanoke Valley .NET User Group</a></li>
<li>October 15th &#8211; <a href="http://chodotnet.org" target="_blank">Charlottesville .NET User Group</a></li>
</ul>
<p>If you&#8217;re attending one of these events, please introduce yourself.</p>
<p>Thank You</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=56</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting to the Richmond Software Craftsmanship Group &#8211; July 30th 2009</title>
		<link>http://www.matthewsposato.net/?p=35</link>
		<comments>http://www.matthewsposato.net/?p=35#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:30:26 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Dynamic Data]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Miscelleanous]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=35</guid>
		<description><![CDATA[Tomorrow I&#8217;m leading a discussion on ASP.NET Dynamic Data to the Richmond Software Craftsmanship Group. Part of this discussion will likely compare and contrast with scaffolding in other frameworks, like Ruby on Rails. Also we&#8217;ll discuss and demonstrate some useful applications of scaffolding. I&#8217;ve attached my presentation slides and the demo projects.ASP.NET Dynamic Data Presentation [...]]]></description>
			<content:encoded><![CDATA[<p>Tomorrow I&#8217;m leading a discussion on ASP.NET Dynamic Data to the <a href="http://groups.google.com/group/RSCG">Richmond Software Craftsmanship Group</a>. Part of this discussion will likely compare and contrast with scaffolding in other frameworks, like Ruby on Rails. Also we&#8217;ll discuss and demonstrate some useful applications of scaffolding. I&#8217;ve attached my presentation slides and the demo projects.ASP.NET Dynamic Data Presentation</p>
<p><a href="http://www.matthewsposato.net/?attachment_id=36">ASP.NET Dynamic Data Presentation &#8211; Powerpoint slides</a></p>
<p><a href="http://www.matthewsposato.net/?attachment_id=38">Dynamic Data Website &#8211; no customizing</a></p>
<p><a href="http://www.matthewsposato.net/?attachment_id=39">Dynamic Data Website &#8211; with customizing</a></p>
<div id="attachment_53" class="wp-caption alignleft" style="width: 310px"><a rel="attachment wp-att-53" href="http://www.matthewsposato.net/?attachment_id=53"><img class="size-medium wp-image-53" title="RSCG Presentation" src="http://www.matthewsposato.net/wp-content/uploads/2009/07/RSCGPresentation-300x225.jpg" alt="Photo courtesy of Kevin Hazzard" width="300" height="225" /></a><p class="wp-caption-text">Photo courtesy of Kevin Hazzard</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=35</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Random Names and Dates</title>
		<link>http://www.matthewsposato.net/?p=30</link>
		<comments>http://www.matthewsposato.net/?p=30#comments</comments>
		<pubDate>Fri, 19 Jun 2009 18:02:32 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=30</guid>
		<description><![CDATA[Code to demonstrate creating realistic names and dates.]]></description>
			<content:encoded><![CDATA[<p>Often, website demos are more compelling when using a copy of production data. However, my current client has no production data. Nonetheless, I want to give them a realistic view of my work. So I needed to create a great deal of realistic looking data. </p>
<p>I began by creating random Customer objects. For the first and last names I could have created random strings. But this particular client would be distracted by the random character names. Silly I know, but that&#8217;s my reality sometimes. First names are often either female or male, so the firstnames collection is an IDictionary<string,char>. The key is the first name and the char is the gender, either &#8216;M&#8217; or &#8216;F&#8217;. This links a name with its typical gender. I wrote extension methods to return a random element from the firstname and lastname collections. The last extension method generates a random date for the DOB. This extension method accepts another date, figures out the number of days between the two dates, let&#8217;s call this value <em>x</em>,  and adds a random number of days between 0 and <em>x</em> to the lesser date to create a new random date, which should always be something between the two date values.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Configuration</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">JCS.Model</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> LoadTestData
<span style="color: #008000;">&#123;</span>
  <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #6666cc; font-weight: bold;">class</span> Program
  <span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> <span style="color: #6666cc; font-weight: bold;">string</span> connection <span style="color: #008000;">=</span> ConfigurationManager<span style="color: #008000;">.</span><span style="color: #0000FF;">ConnectionStrings</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;XXXAAA&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ConnectionString</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">// class variables so they can be used for other names, e.g. parent names</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> Dictionary<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">string</span>, <span style="color: #6666cc; font-weight: bold;">char</span><span style="color: #008000;">&gt;</span> firstnames <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Dictionary<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">string</span>, <span style="color: #6666cc; font-weight: bold;">char</span><span style="color: #008000;">&gt;</span>
      <span style="color: #008000;">&#123;</span><span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Troy&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Jamal&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Alicia&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Gabriel&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Christian&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,
      <span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Benjamin&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Gavin&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Jose&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Brandon&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Dylan&quot;</span>, <span style="color: #666666;">'M'</span><span style="color: #008000;">&#125;</span>,
      <span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Victoria&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Savannah&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Riley&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Hailey&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Nevaeh&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,
      <span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Lily&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Kandis&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span>,<span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Dominique&quot;</span>, <span style="color: #666666;">'F'</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
    <span style="color: #008080; font-style: italic;">// class variables so they can be used for other names, e.g. parent names</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> List<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&gt;</span> lastnames <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&gt;</span>
      <span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Scott&quot;</span>,<span style="color: #666666;">&quot;Stewart&quot;</span>,<span style="color: #666666;">&quot;Sanchez&quot;</span>,<span style="color: #666666;">&quot;Morris&quot;</span>,<span style="color: #666666;">&quot;Rogers&quot;</span>,<span style="color: #666666;">&quot;Reed&quot;</span>,<span style="color: #666666;">&quot;Cook&quot;</span>,
        <span style="color: #666666;">&quot;Morgan&quot;</span>,<span style="color: #666666;">&quot;Bell&quot;</span>,<span style="color: #666666;">&quot;Murphy&quot;</span>,<span style="color: #666666;">&quot;Rivera&quot;</span>,<span style="color: #666666;">&quot;Ward&quot;</span>,<span style="color: #666666;">&quot;Peterson&quot;</span>,
        <span style="color: #666666;">&quot;Watson&quot;</span>,<span style="color: #666666;">&quot;Brooks&quot;</span>,<span style="color: #666666;">&quot;Bennett&quot;</span>,<span style="color: #666666;">&quot;Wood&quot;</span>,<span style="color: #666666;">&quot;Henderson&quot;</span>,<span style="color: #666666;">&quot;Jenkins&quot;</span>,<span style="color: #666666;">&quot;Sanders&quot;</span>,<span style="color: #666666;">&quot;Cox&quot;</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      Random random <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Random<span style="color: #008000;">&#40;</span>DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">Now</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Millisecond</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      DateTime minCustomerDOB <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DateTime<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">1940</span>, <span style="color: #FF0000;">1</span>, <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      DateTime maxCustomerDOB <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DateTime<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">1989</span>, <span style="color: #FF0000;">1</span>, <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #6666cc; font-weight: bold;">string</span> firstname <span style="color: #008000;">=</span> firstnames<span style="color: #008000;">.</span><span style="color: #0000FF;">RandomKey</span><span style="color: #008000;">&#40;</span>random<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      var customer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Customer
                       <span style="color: #008000;">&#123;</span>
                         FirstName <span style="color: #008000;">=</span> firstname,
                         LastName <span style="color: #008000;">=</span> lastnames<span style="color: #008000;">.</span><span style="color: #0000FF;">RandomElement</span><span style="color: #008000;">&#40;</span>random<span style="color: #008000;">&#41;</span>,
                         Gender <span style="color: #008000;">=</span> firstnames<span style="color: #008000;">&#91;</span>firstname<span style="color: #008000;">&#93;</span>,
                         DOB <span style="color: #008000;">=</span> minCustomerDOB<span style="color: #008000;">.</span><span style="color: #0000FF;">RandomDate</span><span style="color: #008000;">&#40;</span>maxCustomerDOB, random<span style="color: #008000;">&#41;</span>
                       <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>var context <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> JCSDBDataContext<span style="color: #008000;">&#40;</span>connection<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
        context<span style="color: #008000;">.</span><span style="color: #0000FF;">Customers</span><span style="color: #008000;">.</span><span style="color: #0000FF;">InsertOnSubmit</span><span style="color: #008000;">&#40;</span>customer<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        context<span style="color: #008000;">.</span><span style="color: #0000FF;">SubmitChanges</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
  <span style="color: #008000;">&#125;</span>
&nbsp;
  <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> Extensions
  <span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">public</span> TKey RandomKey<span style="color: #008000;">&lt;</span>TKey, TValue<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> Dictionary<span style="color: #008000;">&lt;</span>TKey, TValue<span style="color: #008000;">&gt;</span> dictionary, Random random<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> random<span style="color: #008000;">.</span><span style="color: #0000FF;">Next</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0</span>, dictionary<span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      <span style="color: #0600FF; font-weight: bold;">return</span> dictionary<span style="color: #008000;">.</span><span style="color: #0000FF;">ElementAt</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Key</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">public</span> T RandomElement<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> List<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span> list, Random random<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> random<span style="color: #008000;">.</span><span style="color: #0000FF;">Next</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">0</span>, list<span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      <span style="color: #0600FF; font-weight: bold;">return</span> list<span style="color: #008000;">.</span><span style="color: #0000FF;">ElementAt</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">public</span> DateTime RandomDate<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> DateTime min, DateTime max, Random random<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      <span style="color: #6666cc; font-weight: bold;">int</span> days <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>max <span style="color: #008000;">-</span> min<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Days</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #008080; font-style: italic;">// use absolute value in case max is lesser than min</span>
      <span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> random<span style="color: #008000;">.</span><span style="color: #0000FF;">Next</span><span style="color: #008000;">&#40;</span>Math<span style="color: #008000;">.</span><span style="color: #0000FF;">Abs</span><span style="color: #008000;">&#40;</span>days<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      DateTime ranDate <span style="color: #008000;">=</span> min<span style="color: #008000;">.</span><span style="color: #0000FF;">AddDays</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #008080; font-style: italic;">//maybe the max date is actually lesser than the min date.</span>
      <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>max <span style="color: #008000;">&lt;</span> min<span style="color: #008000;">&#41;</span>
        ranDate <span style="color: #008000;">=</span> max<span style="color: #008000;">.</span><span style="color: #0000FF;">AddDays</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
      <span style="color: #0600FF; font-weight: bold;">return</span> ranDate<span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
  <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=30</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting to the Richmond Software Craftsmanship Group</title>
		<link>http://www.matthewsposato.net/?p=27</link>
		<comments>http://www.matthewsposato.net/?p=27#comments</comments>
		<pubDate>Thu, 18 Jun 2009 03:34:58 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=27</guid>
		<description><![CDATA[On Thursday 06/25 I&#8217;m leading a discussion at the Richmond Software Craftsmanship Group. The meeting topic is ASP.NET Dynamic Data. The discussion will likely compare and contrast the Dynamic Data scaffolding to other implementations, such as Ruby on Rails. This presentation was rescheduled for July 30th, 2009.]]></description>
			<content:encoded><![CDATA[<p>On Thursday 06/25 I&#8217;m leading a discussion at the<a href="http://groups.google.com/group/RSCG?pli=1"> Richmond Software Craftsmanship Group</a>. The meeting topic is ASP.NET Dynamic Data. The discussion will likely compare and contrast the Dynamic Data scaffolding to other implementations, such as Ruby on Rails.</p>
<p>This presentation was rescheduled for July 30th, 2009. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=27</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Charlottesville .NET User Group Meeting 06/18</title>
		<link>http://www.matthewsposato.net/?p=25</link>
		<comments>http://www.matthewsposato.net/?p=25#comments</comments>
		<pubDate>Thu, 18 Jun 2009 03:23:32 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[User Group]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=25</guid>
		<description><![CDATA[Justin Etheredge will present &#8220;Building Testable Applications&#8221; to the Charlottesville .NET User Group tomorrow (06/18). The meeting will be at the SNL Headquarters in downtown Charlottesville from 6-8PM. Everyone is welcome.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codethinked.com/">Justin Etheredge</a> will present &#8220;Building Testable Applications&#8221; to the Charlottesville .NET User Group tomorrow (06/18). The meeting will be at the SNL Headquarters in downtown Charlottesville from 6-8PM. Everyone is welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SMTP Testing &#8211; without a live server</title>
		<link>http://www.matthewsposato.net/?p=21</link>
		<comments>http://www.matthewsposato.net/?p=21#comments</comments>
		<pubDate>Tue, 05 May 2009 19:29:17 +0000</pubDate>
		<dc:creator>msposato</dc:creator>
				<category><![CDATA[software testing]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[papercut]]></category>
		<category><![CDATA[SMTP]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.matthewsposato.net/?p=21</guid>
		<description><![CDATA[Using papercut to test outgoing email functionality.]]></description>
			<content:encoded><![CDATA[<p>I recently needed to test email functionality in my application. Normally I&#8217;d point to a SMTP server, like smtp.gmail.com, and go at it. However the message was being sent from a content management system (CMS) that was difficult to configure locally with the ssl required to send a message to gmail or my usual smpt server. Instead I found <a href="http://invalidlogic.com/papercut/">papercut</a>, by Ken Robertson. When running, it listens on the default SMTP port (25), or whatever  port you tell it to listen. It intercepts the message, allowing you to inspect the contents, headers, etc. Both the binaries and source code are available. Thank You Ken Robertson.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewsposato.net/?feed=rss2&#038;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

