<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Jeff's Blog</title>
        <link>http://blogs.sftsrc.com/jeffm/Default.aspx</link>
        <description>Antiferromagnetic Software</description>
        <language>en-US</language>
        <copyright>Jeff Mayeur</copyright>
        <generator>Subtext Version 2.1.1.1</generator>
        <image>
            <title>Jeff's Blog</title>
            <url>http://blogs.sftsrc.com/images/RSS2Image.gif</url>
            <link>http://blogs.sftsrc.com/jeffm/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Validation with JS Objects</title>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/11/02/87.aspx</link>
            <description>&lt;p&gt;Back in the before times, it wasn't such an uncommon thing to hack up an html INPUT to include "extra" attributes like 'errorMsg="Enter a number between 1 and 12" minVal="1" maxVal="12"' to aid in the client side validation of an input. Of course in the modern day web, this practice is well, let's just say undesirable. The most common alternative is to create a bunch of dynamically generated "onblur" and separate on "onsubmit" function calls. &lt;/p&gt;
&lt;p&gt;Things like 'onblur="checkRange(this, 1, 52, 'Enter a valid Week Number');"', combined with "validateSubmit( … code … if(!checkRangeS($get('MyWeekTextBox'),1,15,' Enter a valid Week Number')){ return false; } …more code …);". The basic issue with this approach is there tends to be some duplicated code. On the other hand things like the errorText can be pushed into a "hash" table and accessed as a resource. There are other things that can be done to make this a cleaner approach, but to me they all fall short of using the object like structures of JavaScript. &lt;/p&gt;
&lt;p&gt;What if you create a validation object, attach it to a property on the input, then wire some event handlers, you can define something from any point in the page's client lifecycle that has that write-once, use and re-use goodness of object oriented development. There are several considerations with this approach, the first of which is that depending on your approach you can introduce a fair amount of runtime JavaScript bloat. On the other hand if you really take some time to understand what you're getting into you can create a clean, reusable lightweight validation framework. &lt;/p&gt;
&lt;p&gt;Before I go any farther, let me state in the most direct of language, that Client Side validation is only a usability enhancement for a web application, It has absolutely nothing to do with insuring valid data for processing. It cannot ever be trusted as a reasonable source of validation for any serious data capture system. Sure you can get pretty clever with your client side checks, but remember especially with some of the client JavaScript debugging tools out there, anything you do can be bypassed. So why even do it? Well the vast majority of users will benefit from the aid that rapid client side intervention on erroneous data entry provides. Range, type or required field validations are very helpful to your average user. &lt;/p&gt;
&lt;p&gt;Okay enough tongue wagging. Let's take a look at some functions: &lt;/p&gt;
&lt;p&gt;The numeric validator – In this function we are both, storing the min, max, required, and error message as well as providing a method to initiate the validation. One note, the Validate function takes an &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj&lt;/span&gt; parameter, and truthfully this is not really necessary, because this validator will be assigned to an input, it can carry a reference to the input it is validating and do away with that parameter. I'm not a fan of that, I liken to say a Domain with Person and Car. A Person may have 1-n Cars, and a Person may Sell a Car, but a Car cannot sell itself from a Person. Even though the data defines the relationship as 2 way, there is a clear owner and owned that define who in Code should really know about the other. In effect Person may have a Collection of Cars, but a Car might only have a PersonID, a pointer, but not a reference to its owner. When I thought about this object based validation this seems like a good approach. &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; numVdtrSet(req, min, max, msg){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Req = req; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Min = min; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Max = max; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Msg = msg; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Error_handler = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Value = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Validate = &lt;span style="COLOR: blue"&gt;function&lt;/span&gt;(obj){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Value = obj.value; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (!validateNumberField(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;)){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj.error = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj.error = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;The validator creation and assignment – Here we're creating the validator, and if an event is provided wiring it up. In our case the we will be passing in an iEvt of onblur for the textbox, and an evt of focus to pull the cursor back. Critical to this is tracking the error state of the input, if we've flagged it as bad, let's not keep pulling them back in an endless loop. We have a submit check, and remember this is only meant to be helpful, not strict enforcement.&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; setHandler(obj, iEvt, req, min, max, msg, evt){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj.error = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj.validator = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; numVdtrSet(req, min, max, msg); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj.validator.Error_handler = &lt;span style="COLOR: blue"&gt;function&lt;/span&gt;(s){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;alert(&lt;span style="COLOR: #a31515"&gt;"Error: "&lt;/span&gt; + s + &lt;span style="COLOR: #a31515"&gt;"\r\n"&lt;/span&gt; + &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Msg); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;(evt &amp;amp;&amp;amp; !obj.error){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj[evt](); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;$addHandler(obj, iEvt, doValidation); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;The validator – nothing special here, it's not the best validation check, but this is part that should be most familiar if you've ever done client side validation. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; validateNumberField(vldtr){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; _iVal = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (vldtr.Req || vldtr.Value != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;try&lt;/span&gt; { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;_iVal = parseInt(vldtr.Value) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (isNaN(_iVal)){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;processError(&lt;span style="COLOR: #a31515"&gt;"type"&lt;/span&gt;, vldtr); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;span style="COLOR: blue"&gt;catch&lt;/span&gt;(e){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;processError(&lt;span style="COLOR: #a31515"&gt;"type"&lt;/span&gt;, vldtr); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (vldtr.Min &amp;amp;&amp;amp; (vldtr.Min &amp;gt; _iVal)){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;processError(&lt;span style="COLOR: #a31515"&gt;"minimum"&lt;/span&gt;, vldtr); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (vldtr.Max &amp;amp;&amp;amp; (vldtr.Max &amp;lt; _iVal)){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;processError(&lt;span style="COLOR: #a31515"&gt;"maximum"&lt;/span&gt;, vldtr); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The error handler – if ones provided call out to it. &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; processError(errType, vldtr){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (vldtr.Error_handler){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;vldtr.Error_handler(errType); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;The triggers – what fires these validations. &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; doValidation(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.validator){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.validator.Validate(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; onSubmit(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; inps = document.forms[0].getElementsByTagName(&lt;span style="COLOR: #a31515"&gt;"input"&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; i=0;i&amp;lt;inps.length;i++){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (inps[i].validator){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (!inps[i].validator.Validate(inps[i])){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;The markup – actual usage&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;Enter a score between 50 and 3000:&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;input&lt;/span&gt; &lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text"&lt;/span&gt; &lt;span style="COLOR: red"&gt;id&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="score"&lt;/span&gt; &lt;span style="COLOR: red"&gt;name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="box"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;br&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;Enter a number between 5 and 15:&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;input&lt;/span&gt; &lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text"&lt;/span&gt; &lt;span style="COLOR: red"&gt;id&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="num"&lt;/span&gt; &lt;span style="COLOR: red"&gt;name&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="box"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;br&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="FakeSubmit"&lt;/span&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="FakeSubmit"&lt;/span&gt; &lt;span style="COLOR: red"&gt;OnClientClick&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="return onSubmit();"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;script&lt;/span&gt; &lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text/javascript"&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; setValidations(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;setHandler(document.getElementById(&lt;span style="COLOR: #a31515"&gt;'score'&lt;/span&gt;), &lt;span style="COLOR: #a31515"&gt;'blur'&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, 50, 3000, &lt;span style="COLOR: #a31515"&gt;'Enter a valid score between 50 and 3000'&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;'focus'&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;setHandler(document.getElementById(&lt;span style="COLOR: #a31515"&gt;'num'&lt;/span&gt;), &lt;span style="COLOR: #a31515"&gt;'blur'&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, 5, 15, &lt;span style="COLOR: #a31515"&gt;'Enter a valid number between 5 and 15'&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;'focus'&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;window.onload=setValidations; &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;script&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I mentioned using this pattern in front of a WebMethod. That's still my intent, but this ended up being a lot to post, so we'll have to cover that in a subsequent post. This isn't a fully polished validator, rather just a pattern for perusal. I like the idea of working a more formal typed/oop process, even if JavaScript doesn't really enforce it.&lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/87.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/11/02/87.aspx</guid>
            <pubDate>Sat, 03 Nov 2007 06:17:13 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/11/02/87.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/87.aspx</wfw:commentRss>
        </item>
        <item>
            <title>More of this</title>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/11/01/86.aspx</link>
            <description>&lt;p&gt;Quick note, I'm still plugging away at prepping my .sdf file for my domain series, but it's slow going. I should be back into that series by Monday 11/5, but in the mean time, more on &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Lucida Console"&gt;this&lt;/span&gt;. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here are there functions that are using the &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;checkthis&lt;/span&gt; function we defined &lt;strong&gt;&lt;em&gt;here&lt;/em&gt;&lt;/strong&gt; as well as using &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Lucida Console"&gt;this&lt;/span&gt; to reference some data. The results of the &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;alert&lt;/span&gt; portion of these functions almost always gives me pause, and if it's been a few weeks since I last thought in JS, I probably would get them wrong. There are some parts that are not to odd, but 2 points usually catch me. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;In &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;xBthis &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.myvar&lt;/span&gt; refers to the externally declared &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;myvar&lt;/span&gt;. This is somewhat intuitive, it's just troubling, and potentially a gotcha, that you can have both &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;myvar&lt;/span&gt;s exist without conflicting, or overwriting values. &lt;/li&gt;
    &lt;li&gt;The non &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Lucida Console"&gt;this&lt;/span&gt; –ed &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;myvar &lt;/span&gt;in the x function, refers to the externally declared &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;myvar&lt;/span&gt; as well. Again, it sort of makes sense, as I haven't explicitly scoped it, but it's just plain odd. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; myvar = &lt;span style="COLOR: #a31515"&gt;'0023'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; xAthis(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    &lt;span style="COLOR: blue"&gt;var&lt;/span&gt; x = &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.myvar; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    alert(&lt;span style="COLOR: #a31515"&gt;'x is: '&lt;/span&gt; + x + &lt;span style="COLOR: #a31515"&gt;', myvar is: '&lt;/span&gt; + myvar); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    checkthis(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; xBthis(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    &lt;span style="COLOR: blue"&gt;var&lt;/span&gt; myvar = &lt;span style="COLOR: #a31515"&gt;'234'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    &lt;span style="COLOR: blue"&gt;var&lt;/span&gt; x = &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.myvar; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    alert(&lt;span style="COLOR: #a31515"&gt;'x is: '&lt;/span&gt; + x + &lt;span style="COLOR: #a31515"&gt;', myvar is: '&lt;/span&gt; + myvar); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    checkthis(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; xCthis() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{     &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    &lt;span style="COLOR: blue"&gt;var&lt;/span&gt; fn = &lt;span style="COLOR: blue"&gt;function&lt;/span&gt;(){}; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    fn.myvar = &lt;span style="COLOR: #a31515"&gt;'AADS'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    fn.foo = &lt;span style="COLOR: blue"&gt;function&lt;/span&gt;(){ &lt;span style="COLOR: blue"&gt;var&lt;/span&gt; x = &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.myvar; alert(&lt;span style="COLOR: #a31515"&gt;'x is: '&lt;/span&gt; + x + &lt;span style="COLOR: #a31515"&gt;', myvar is: '&lt;/span&gt; + myvar); checkthis(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;); }; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    fn.foo(); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;The output from these calls are as follows (not including the checkthis output): &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;xAthis-- x is: 0023, myvar: 0023 &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;xBthis-- x is: 0023, myvar: 234 &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;xCthis-- x is: AADS, myvar: 0023 &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So what, right? Well, there are some times, when you can use the &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this&lt;/span&gt; your advantage. Consider this line from yesterday's script. This is a pretty common usage of this, the OnClick even of a button very often passes a &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this&lt;/span&gt; into a function to avoid storing variable references all over the place: &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;dv.ondblclick = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; Function( &lt;span style="COLOR: #a31515"&gt;"document.documentElement.removeChild(this);disposeObj(this);"&lt;/span&gt; );&lt;/span&gt; 
&lt;p&gt;In fact you can get creative, or really you can just start to treat JS much more like C#. Say you have a bunch of elements you need to "style" when a button is clicked, first you define a container to hold a the style definition &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; styleObj(className, visible, top, left, zIndex){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.ClassName == className; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Visible = visible; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Top = top; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Left = left; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Zindex = zIndex; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;}&lt;/span&gt; 
&lt;p&gt;Create factory: &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; styleFactory(obj){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (obj.checkState){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; styleObj(&lt;span style="COLOR: #a31515"&gt;"Foo"&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"10px"&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"50px"&lt;/span&gt;, 1000); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;else&lt;/span&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt; styleObj(&lt;span style="COLOR: #a31515"&gt;"Foo"&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"80px"&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"50px"&lt;/span&gt;, 1000); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;Then you can write something like this: &lt;/p&gt;
&lt;p&gt;&amp;lt;input type="checkbox" id="cbx" value="01"/&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;lt;input type="button" id="cbxbtn" onclick="doStyle(styleFactory(this));" /&amp;gt; &lt;/p&gt;
&lt;p&gt;And run this script on load: &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; init(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; inp &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; document.getElementsByTagName(&lt;span style="COLOR: #a31515"&gt;"input"&lt;/span&gt;)){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (inp.type == &lt;span style="COLOR: #a31515"&gt;"checkbox"&lt;/span&gt;){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;document.getElementById(inp.id + &lt;span style="COLOR: #a31515"&gt;"btn"&lt;/span&gt;).checkState = inp; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;Not particularly useful, but the idea is that you can use references, and objects just like you would in C#, it saves lookups, extra variables and other nonsense. Next time, I'm going to use this type of relationship chaining to show a way to manage some client side validation to support a WebMethod based UI… &lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/86.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/11/01/86.aspx</guid>
            <pubDate>Fri, 02 Nov 2007 04:58:58 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/11/01/86.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/86.aspx</wfw:commentRss>
        </item>
        <item>
            <title>The This in this</title>
            <category>AjaxToolkit</category>
            <category>ModalPopupExtender</category>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/31/85.aspx</link>
            <description>&lt;p&gt;There are many churlish titles that I could use for this post, but for now I'll moderate my juvenile sense of humor. Today I'm just going to show a simple JavaScript function that pokes around a 'this' to see what it smells like. First off I'm not really planning to go to the level of the ECMA Script specs, nor really am I planning a thorough explanation of the object-like structures of JavaScript functions. I'm going to cover the basics of understanding context, and how to use it, and how it can cause headaches at some point. For a more detailed explanation, check out &lt;a href="http://odetocode.com/Blogs/scott/archive/2007/07/03/11060.aspx"&gt;K Scott Allen's blog&lt;/a&gt; he's got some really good posts on JavaScript scoping. &lt;/p&gt;
&lt;p&gt;What I'm interested is in talking briefly about why in &lt;a href="http://blogs.sftsrc.com/jeffm/archive/2007/10/30/FindComponent.aspx"&gt;yesterday's post&lt;/a&gt; I wrote the following: &lt;/p&gt;
&lt;p style="BACKGROUND: white; MARGIN-LEFT: 36pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;extender = Sys.Application.findComponent(extenderID); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      extender._lyt = extender._layout; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      &lt;span style="COLOR: red"&gt;extender._layout = function layoutExtension(){ &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="COLOR: red"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         alert('a'); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        if (_doLayout &amp;amp;&amp;amp; this._lyt) &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        { &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;           alert('g'); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style="BACKGROUND: white; MARGIN-LEFT: 36pt"&gt;&lt;span style="COLOR: red"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;            _doLayout = false; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;            this._lyt(); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        } &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      &lt;span style="COLOR: red"&gt;}; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;The &lt;span style="COLOR: red"&gt;red section&lt;/span&gt; is what I'm focusing on, why and what does the "&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Courier New"&gt;this&lt;/span&gt;" mean here, and why don't I just write something like: &lt;/p&gt;
&lt;p style="BACKGROUND: white"&gt;    &lt;span style="COLOR: #365f91"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;function doLayout(){ &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         alert('a'); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        if (_doLayout &amp;amp;&amp;amp; this._lyt) &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        { &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;           alert('g'); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style="BACKGROUND: white"&gt;&lt;span style="COLOR: #365f91"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;            _doLayout = false; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;            _lyt(); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        } &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      }; &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style="BACKGROUND: white; MARGIN-LEFT: 36pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #365f91; FONT-FAMILY: Courier New"&gt;var _lyt = null; &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style="BACKGROUND: white; MARGIN-LEFT: 36pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;function() ….{ &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p style="BACKGROUND: white; MARGIN-LEFT: 36pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;extender = Sys.Application.findComponent(extenderID); &lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      &lt;span style="COLOR: #365f91"&gt;lyt = extender._layout; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #365f91; FONT-FAMILY: Courier New"&gt;      extender._layout = doLayout;&lt;/span&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The real answer lies in the extenders' function _layout(): &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;_layout : &lt;span style="COLOR: blue"&gt;function&lt;/span&gt;() { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: green"&gt;/// &amp;lt;summary&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: green"&gt;/// Position the modal dialog &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: green"&gt;/// &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: Courier New"&gt;… &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; xCoord = 0; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; yCoord = 0; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;._xCoordinate &amp;lt; 0) { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; foregroundelementwidth = &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;._foregroundElement.offsetWidth? &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;._foregroundElement.offsetWidth: &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;._foregroundElement.scrollWidth; &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Notice the reference to the &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this&lt;/span&gt; object. If I were to set &lt;span style="FONT-SIZE: 10pt; COLOR: #365f91; FONT-FAMILY: Courier New"&gt;extender._layout&lt;/span&gt; equal to a function defined in the scope of the page, when I delegate down to the _layout function, the &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this &lt;/span&gt;object wouldn't have a &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;foregroundElement &lt;/span&gt;to interrogate. However when I essentially extend the original like this, &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;extender._lyt = extender._layout the &lt;span style="COLOR: blue"&gt;this &lt;/span&gt;&lt;/span&gt;object refers to the extender itself. Unlike the friendly world of C# where &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this &lt;/span&gt;always refers the object that contains the actual code, &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this &lt;/span&gt;in this case is much more akin to something generated using the Reflection.Emit or code generation functionality. It's all about the context of execution. Because JavaScript is such a fuzzy language, it's easy to get tripped up on where variables and functions are scoped. I've tripped myself up more than once by using the same var name in both a global and local context, or worse still by re-declaring a function or variable. Unfortunately I don't have any great tips for avoiding pitfalls like that, other than when you put a page together from multiple controls that each might have their own JavaScript, take the time to open up &lt;a href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/a&gt; or some other JS Debugger and look at what's on the page. &lt;/p&gt;
&lt;p&gt;Being that I'm somewhat of a trial-and-error based web developer, when I was tinkering around with the code above, actual did forget to take execution context into account. Basically I use the rule that a &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this &lt;/span&gt;in the scope of a function, always refers to the containing object, if it's the page, the containing object is the document, if it's a property or prototype on function, its containing object is its parent function. This translates something like this; if you see some code &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;x.foobar = &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.myvar; &lt;span style="COLOR: blue"&gt;this &lt;/span&gt;&lt;/span&gt;refers not to &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;x&lt;/span&gt; but to &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;x&lt;/span&gt; 's containing object; whereas &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;x.foofoo = &lt;span style="COLOR: blue"&gt;function&lt;/span&gt;(){ alert(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.toString());} &lt;span style="COLOR: blue"&gt;this &lt;/span&gt;&lt;/span&gt;refers to &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;x&lt;/span&gt;. This is because the &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this &lt;/span&gt;is being referenced inside (in the scope or execution context of) something that is defined as a method/property/extension/prototype of &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;x. &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Okay so the last thing I want to toss in is a simple function I use sometimes to figure out what &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this &lt;/span&gt;I'm really working with. In reality any JS object can be tossed at it, and it will pour out its contents. Although this function dumps its output to a &amp;lt;div/&amp;gt; it's pretty easy to extend it to dump its output to an Xml string, and then in turn push that into a grid, with links that allow drilldowns, and pretty soon you have a very simple JS Watch window, but I'm the type who likes quick and dirty, so here it is. Basically it just pokes an object to see what's been hung on it, and dumps the output to a div. It's somewhat tweaked to poke AjaxToolkit objects whit the extra get_ checks, but that can be pulled or other customizations like checking specific HTML Properties/Attributes could be added, hope this is useful to someone. &lt;/p&gt;
&lt;p&gt;USAGE &lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;… code … &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;checkthis(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;… more code … &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; checkthis(obj, useAlertBit){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;(!obj){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     &lt;span style="COLOR: blue"&gt;throw&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;'Cannot evalutate null'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; crlf = (useAlertBit) ? &lt;span style="COLOR: #a31515"&gt;'\r\n'&lt;/span&gt; : &lt;span style="COLOR: #a31515"&gt;'&amp;lt;br /&amp;gt;'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; error = &lt;span style="COLOR: #a31515"&gt;''&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; output = &lt;span style="COLOR: #a31515"&gt;'obj - Properties'&lt;/span&gt; + crlf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;    + getVal(obj, &lt;span style="COLOR: #a31515"&gt;'id'&lt;/span&gt;) + crlf &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     + getVal(obj, &lt;span style="COLOR: #a31515"&gt;'_id'&lt;/span&gt;) + crlf &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     + &lt;span style="COLOR: #a31515"&gt;'Type: '&lt;/span&gt; + &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(obj) + crlf+ crlf; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;var&lt;/span&gt; i &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; obj){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     &lt;span style="COLOR: blue"&gt;try&lt;/span&gt; { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         output += i + &lt;span style="COLOR: #a31515"&gt;': '&lt;/span&gt; + obj[i] + crlf; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (i.indexOf(&lt;span style="COLOR: #a31515"&gt;'get_'&lt;/span&gt;) != -1 &amp;amp;&amp;amp; obj[i]){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;             output += i +&lt;span style="COLOR: #a31515"&gt;'-Value: '&lt;/span&gt; + obj[i]() + crlf + crlf; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         &lt;span style="COLOR: blue"&gt;else&lt;/span&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;             output += crlf; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     } &lt;span style="COLOR: blue"&gt;catch&lt;/span&gt; (e) { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         &lt;span style="COLOR: green"&gt;//alert(e.message); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         error += &lt;span style="COLOR: #a31515"&gt;'Error: '&lt;/span&gt; + i + &lt;span style="COLOR: #a31515"&gt;' - '&lt;/span&gt; + e.message + &lt;span style="COLOR: #a31515"&gt;'\r\n'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (error != &lt;span style="COLOR: #a31515"&gt;''&lt;/span&gt;){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     alert(error); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
 &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (useAlertBit){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     alert(output); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;else &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     &lt;span style="COLOR: blue"&gt;var&lt;/span&gt; dv = document.createElement(&lt;span style="COLOR: #a31515"&gt;'div'&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     document.documentElement.appendChild(dv); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.width = &lt;span style="COLOR: #a31515"&gt;'1024px'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.height = &lt;span style="COLOR: #a31515"&gt;'800px'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.overflow = &lt;span style="COLOR: #a31515"&gt;'auto'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.position = &lt;span style="COLOR: #a31515"&gt;'absolute'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.visibility = &lt;span style="COLOR: #a31515"&gt;'visible'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.display = &lt;span style="COLOR: #a31515"&gt;''&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.backgroundColor = &lt;span style="COLOR: #a31515"&gt;'#ffffcc;'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.border = &lt;span style="COLOR: #a31515"&gt;'solid 1px #0000cc'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.top = &lt;span style="COLOR: #a31515"&gt;'50px'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.left = &lt;span style="COLOR: #a31515"&gt;'5px'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.style.zIndex = &lt;span style="COLOR: #a31515"&gt;'100'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.title = &lt;span style="COLOR: #a31515"&gt;'Double Click to close'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.ondblclick = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; Function( &lt;span style="COLOR: #a31515"&gt;"document.documentElement.removeChild(this);disposeObj(this);"&lt;/span&gt; ); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;     dv.innerHTML = &lt;span style="COLOR: #a31515"&gt;'&amp;lt;pre&amp;gt;'&lt;/span&gt; + output + &lt;span style="COLOR: #a31515"&gt;'&amp;lt;/pre&amp;gt;'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; getVal(obj, key){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (obj[key] != &lt;span style="COLOR: #a31515"&gt;'undefined'&lt;/span&gt;){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; key +&lt;span style="COLOR: #a31515"&gt;': '&lt;/span&gt; + obj[key]; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; key +&lt;span style="COLOR: #a31515"&gt;': N/A'&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;}; &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;function&lt;/span&gt; disposeObj(obj){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;obj = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;}&lt;/span&gt; &lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/85.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/31/85.aspx</guid>
            <pubDate>Thu, 01 Nov 2007 05:45:23 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/31/85.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/85.aspx</wfw:commentRss>
        </item>
        <item>
            <title>FindComponent</title>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/30/84.aspx</link>
            <description>&lt;p&gt;I'm taking a few posts off from my &lt;a href="http://blogs.sftsrc.com/jeffm/archive/2007/10/24/Domain-in-the-Box-Part-1.aspx"&gt;Domain in the Box series&lt;/a&gt; mostly because I'm taking the time to move my data from a bunch of static methods in code to a nice neat like Sql Data File (.sdf) in VS 2008 Beta 2 (did I mention that I'm sold, really sold on Beta 2). That's going to be a tedious process that will take a few days, so when I'm done I'm going to pick that series up once I'm a little farther along with the move. In the interim I'm going to address a few short topics around poking the AjaxToolKit with stick. &lt;/p&gt;
&lt;p&gt;Today's topic? The &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;Sys.Application.findComponent &lt;/span&gt;function. Components. I've used it before &lt;a href="http://blogs.sftsrc.com/jeffm/archive/2007/10/13/Making-the-most-out-of-the-AjaxControlToolkits-ModalPopupExtender-Part-7.aspx"&gt;here&lt;/a&gt;, but I've not really covered why you might use it. Basically I've used it for the task of adding event handlers to an extender. Like in the linked post above, I will search for an extender, and then wire up an event hander and that's about it. And for this post I'm going to provide another simple example of that, but there's a few other reasons you might want to poke around a component. One such case is the "_layout" function of the ModalPopupExtender. In the &lt;a href="http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=4923"&gt;&lt;span style="FONT-SIZE: 15pt; FONT-FAMILY: Segoe UI"&gt;10618&lt;/span&gt;&lt;/a&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: Segoe UI"&gt; &lt;/span&gt;release I encountered an annoying side effect with the changing the innerHTML of a ModalPopupExtender. Any time that I swapped the content dynamically, it would reposition the Modal. This is on one hand a desired behavior, but I would also be nice to turn it off, so here's a little script I used to solve that issue. &lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;script&lt;/span&gt; &lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text/javascript"&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;   var&lt;/span&gt; extenderID = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;   var&lt;/span&gt; extender = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;   var&lt;/span&gt; _doLayout = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;   function&lt;/span&gt; hideSet(sender, args){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;      var&lt;/span&gt; cncl = confirm(&lt;span style="COLOR: #a31515"&gt;'Are you sure you want to close?'&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;      if&lt;/span&gt; (!cncl){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        _doLayout = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         args.set_cancel(&lt;span style="COLOR: blue"&gt;true&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;   } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;   function&lt;/span&gt; reg_init(exID) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;   { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;      if&lt;/span&gt; (!extender){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         extenderID = exID; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         Sys.Application.add_load(init); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;   } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;   function&lt;/span&gt; init(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;      if&lt;/span&gt; (!extender){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      extender = Sys.Application.findComponent(extenderID); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      extender._lyt = extender._layout; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      extender._layout = &lt;span style="COLOR: blue"&gt;function&lt;/span&gt; layoutExtension(){ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;         alert(&lt;span style="COLOR: #a31515"&gt;'a'&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;        if&lt;/span&gt; (_doLayout &amp;amp;&amp;amp; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;._lyt) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        { &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;           alert(&lt;span style="COLOR: #a31515"&gt;'g'&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;            _doLayout = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;            this&lt;/span&gt;._lyt(); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;        } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      }; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;      extender.add_hiding(hideSet); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;   } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;script&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;Called in code behind: &lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;ScriptManager&lt;/span&gt;.RegisterStartupScript(&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;, GetType(), &lt;span style="COLOR: #a31515"&gt;"main"&lt;/span&gt;, &lt;span style="COLOR: #a31515"&gt;"reg_init('"&lt;/span&gt; + FindThisModalExtender.ClientID + &lt;span style="COLOR: #a31515"&gt;"');"&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;);&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Basically I'm just pushing the original _layout function into a new bucket, and adding a check to see if I really want to perform a layout. It's a pretty simple and sometimes useful trick, the big downside is that I'm violating the implied convention that all JS variables, and functions that start with "_" are private, and subject to change. In reality what I should do is open up the toolkit and give myself a public hook, except that in the end, my implementation will be just as fragile. When I update to a new version of the toolkit, I either would have to possibly redo my hack or possible redo my customization of the ModalPopupExtender depending on what's been fixed or changed in the toolkit. What's the &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this&lt;/span&gt; in &lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier New"&gt;this&lt;/span&gt;. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/84.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/30/84.aspx</guid>
            <pubDate>Wed, 31 Oct 2007 06:19:52 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/30/84.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/84.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Domain in the Box Part 5</title>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/29/83.aspx</link>
            <description>&lt;p&gt;Next on the docket is a rough outline of the University Domain area.  Basically it will look something like this (sometimes those class diagrams are pretty handy).
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;img src="http://blogs.sftsrc.com/images/blogs_sftsrc_com/jeffm/103007_0541_Domaininthe1.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;But here's another set of tough choices to make along the lines of Parentage.  For instance, are the People a property of the University, or College to which they are associated?  Probably not, but the only way to tell would be to get some more clarification on how this data is likely to be used by my eventual fictional application.
&lt;/p&gt;&lt;p&gt;If this system were to back a national university ranking system, it might just be that the majority of the time when an end user is working with the University Domain object they will in fact be working with its entire set of students.  Only I'm not really designing this for an oddball case like that one, which leads me to a more basic question: Why am I doing this, or more importantly where are we going with this?
&lt;/p&gt;&lt;p&gt;Sure I'm working to make a canned Domain so I can explore new technologies, but I do have a more immediate goal in mind.  When I complete this series I'm first going to put together a simple Class Registration system first in Silverlight and then in Ajax.ASP.Net to show some of the pros and cons of each.  Mainly I'm going to use the more polished Dynamic Modal covered &lt;a href="http://blogs.sftsrc.com/jeffm/archive/2007/10/06/Making-the-most-out-of-the-AjaxControlToolkits-ModalPopupExtender-Part-1.aspx"&gt;here&lt;/a&gt; to drive a Grid based application.  
&lt;/p&gt;&lt;p&gt;That said, when I think about the choices of developing relationships for my Domain objects, I realize that at least initially this Domain set should really be focused on the StudentStatus, StudentHistory, EmployeeStatus, EmployeeHistory and Class objects.  To really flesh out this domain I need to get a full understanding of these objects.  Then I'll double back on my University hierarchy and person hierarchy.  
&lt;/p&gt;&lt;p&gt;So here's my initial pass at the first object in that chain Student Status.  
&lt;/p&gt;&lt;p&gt;&lt;img src="http://blogs.sftsrc.com/images/blogs_sftsrc_com/jeffm/103007_0541_Domaininthe2.png" alt="" /&gt;
	&lt;/p&gt;&lt;p&gt;All I'm shooting for here is to capture, what person, what classes, and what what's the state of the schedule.  This data will be augmented by History records and by a StudentRecord that will act as the link between the College and the student. 
&lt;/p&gt;&lt;p&gt;As a general note I'm planning to switch to these class diagrams, they're a lot more meaningful that the ugly code snippets I've been using and at least for the next new posts nothing interesting is going into the code anyway.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/83.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/29/83.aspx</guid>
            <pubDate>Tue, 30 Oct 2007 05:41:18 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/29/83.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/83.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Domain in the Box Part 4</title>
            <category>Domain Objects</category>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/28/81.aspx</link>
            <description>&lt;p&gt;Roles? This is definitely one of the areas I've had the most trouble with when I try to understand my fictitious Plebian U Domain. In my original model, roles defined both a person's relationship to the University either employee (of a specific type ex, Professor, Adminstrator, GroundsKeeper etc) or student (graduate, undergrad, post-grad), and status/ fulltime and part time. On my original person object there was no concept of a Roles list (it was build on .Net 1.1, so no generics). The way I had built my layers, the BLL would call into the DAL with a specific RoleID and get back a list of all people in that role. &lt;/p&gt;
&lt;p&gt;In this retouching of my Bag-O-Tricks I'm planning on using LINQ in the BLL to make those types of selections. This gives me 2 benefits, 1&lt;sup&gt;st&lt;/sup&gt; if a person does have multiple roles I know long will need to load the same exact person record up more than once, and second I think I'll be able to simplify the scope of the Role domain object. The big problem that I've always had with my original approach is that I felt that the Role object was really trying to encapsulate 2 distinct pieces of data. 1&lt;sup&gt;st&lt;/sup&gt; the PersonToUniversityRelationShip and 2&lt;sup&gt;nd&lt;/sup&gt; the PersonEmploymentType or PersonStudentType. Right now I'm basically looking at Role to define a person as an Employee, a Student or both. &lt;/p&gt;
&lt;p&gt;In fact I'm not even sure that I'll have a Role object in my finalized Domain, in some ways it's a vestige of past incarnations, like the appendix, that while it might not cause any issues may not serve any real purpose. The data that I'm really going to care about is going to shift to two new domain objects tentatively called PersonEmploymentStatus and PersonEnrollmentStatus. I'm inclined at least at the Database layer so that I can use FK's to constrain the values. The status tables will let me define the attributes like type of Employee as well as more detailed information like what Colleges is the person associated with. &lt;/p&gt;
&lt;p&gt;I'm not entirely sold on this yet, but I think that in the end I will go away from using Roles and just use LINQ to JOIN the Status objects with the Person objects to get the specific Employee and Student records. Some of that will be shaken out when I start to flesh out the Status objects and see how they relate to the EmplomentHistory and StudentHistory records that I had in my original Domain set, but I'm not in too much of a hurry to choose, the PersonRole class I have is very small, and using the Generate Unit Tests facility of VS 2008 Beta 2 makes very short work of the unit test for these objects. &lt;/p&gt;
&lt;p&gt;Currently I have only this for my PersonRole object: &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PersonRole &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? RoleID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; RoleName { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; RoleDescription { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; PersonRole() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; PersonRole(&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? roleID, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; roleName, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; roleDescription) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.RoleID = roleID; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.RoleName = roleName; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.RoleDescription = roleDescription; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;thing that has always been difficult for me when I try to extract the individual entities from the domain, is knowing just how far to break things down. Think about something like a Date, in truth a Data can be thought of as three separate objects, a Month, Day and Year. In fact it wasn't on common in the days before Ajax Calendars to create a Data as either 3 separate Text-Boxes or Drop-Down Lists. Sure on the server side these fields are usually recombined to create a full Date object, but it's not inconceivable to consider the constituents as independent objects, especially for specific validation requirements, like verifying that a Date is on a Monday or Thursday. &lt;/p&gt;
&lt;p&gt;Now I have never seen, nor would I ever recommend splitting out the a Date into 3 separate Domain objects. However I have seen ActivityDate as a fully fledged Domain object. Every table that needed to store an Activity Data would make an entry In the FKeyed Activity table, and the ActivityDate consisted of a UserID, DataTime and ActivityID. In this case the abstraction made some sense based on the reporting requirements of the System. One report that was given a very high deliverable rating was the ability to at a glance see what employee had performed what actions for a given Date Range. Sure each table could have an ActivityDate field, and some report could do multiple selects and compile the results, but for both efficiency and ease of maintenance it made sense to create a fully fledged entity. It made even more sense to push this into the Domain, as it made it very clear to all consumers of the Domain objects that the Activity tracking was really a first class object. &lt;/p&gt;
&lt;p&gt;For this project both the first time I looked at this, and this time the Roles area really was one of the places where I struggled the most to find a clean set of fault-lines to traverse. Sure there were other areas where I could vastly improve my design, but none where I felt quite as unsure. Hopefully as I work into the BLL of this project I will start to recognize the signs of a good clean set of domain objects.&lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/81.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/28/81.aspx</guid>
            <pubDate>Mon, 29 Oct 2007 05:18:45 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/28/81.aspx#feedback</comments>
            <slash:comments>40</slash:comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/81.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Wild Wild Web</title>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/27/80.aspx</link>
            <description>&lt;p&gt;This is a little interruption to cover something that's on my mind a lot lately.  One of the more interesting attributes of a truly good web developer is design based on what's possible.  The web is a much more fickle place than a database.  There are hard predictable albeit often confounding reasons that govern the way databases work.  The web, while still mostly governed by reason and known rules of invocation, has an edge of unpredictability.  Partly this is due to differing interpretations of standards "compliance" helped along for better or worse with Microsoft's strong tradition of backward compatibility, but partly this is due to number of layers that exist between users and the systems that they are working against.
&lt;/p&gt;&lt;p&gt;Think about a group of dominoes standing on edge all spaced perfectly to create a chain reaction of falling down when the one is knocked done.  If you're like me you've &lt;a href="http://www.youtube.com/watch?v=YocnQ0NMTUA"&gt;tinkered&lt;/a&gt; with making these elaborate chains of dominoes to both test your ability to plan and execute as well as just the pure fun of seeing things fall.  Setting up dominoes to be knocked down can become a pretty elaborate task, but as long as you can see all of the dominoes and insert appropriate checks to prevent unintended consequences it's not terribly hard, just tedious.  But what happens if you're not able to see certain dominoes, or stretches through which the dominoes will pass.  How do insure there are proper checks, how do you verify the spacing to insure that there won't be a break in your chain.  What about possible recovery plans in case there is a collapse, or a break in your chain?
&lt;/p&gt;&lt;p&gt;The trouble with the web is that there is so much that is out of your hands.  On the one hand, it's a fantastic benefit that someone has worked out the very complex issues of network communication; on the other hand you have to work with its inherent limitations.  This type of uncertainty often leads to prototype heavy architecture, or at least is should.  Sure you can take applied knowledge to a new problem and do a fair amount of traditional upfront architecture, but in reality web development for better or worse often starts at the level of the Wire Frame or the Mocked up website.  
&lt;/p&gt;&lt;p&gt;You can see this effect in the current &lt;a href="http://blogs.sftsrc.com/jeffm/archive/2007/10/24/Domain-in-the-Box-Part-1.aspx"&gt;blog series&lt;/a&gt; that I'm working on, where I'll be somewhat unconcerned with nailing down the absolutes of a pattern, and more interested in getting something I can work with in a real User Case to fully flesh out the design.  There's definitely an air of XP to it, but it's not pure XP.  I like test driven, and XP, but I think it's sometimes slower than it needs to be.  There are some things you just know as a developer, especially after a few years of coding, so there are just going to be those things where it's better to code an unit test in a more fluid manner than is often implied by XP.  
&lt;/p&gt;&lt;p&gt;The idea is basically to start with what can be done and code/design back to how it should be done.  This approach can influence every layer of the application, from how domain properties are grouped to the thickness and groupings of the BLL, to the type of Data access Layer that best fits the UI.  And as much as this goes against the vast majority of literature on good design, I does work, most of the time.
&lt;/p&gt;&lt;p&gt;The key to this equation is the disposability of the web.  A website can become out-dated in 2 years, and borderline obsolete in three.  Sure good Designer work can buy you a little more life time, but the User facing portion of a website has a very short shelf life.  And while the backend can certainly outlast the thrashing of UI level intricacies, there's a lot of pressure on back ends of websites to implement the latest and greatest pattern from the ever churning best practices mill.
&lt;/p&gt;&lt;p&gt;The thing that strikes me as the good in this approach is the focus on possibility and the built in recognition that flexibility is paramount to success, but the negatives are vast and deep.  The primary among these is the combination of a company's and a developer's ability to stay committed to a project.  If they are committed, the developer can fully evolve their creation into a healthy maintainable state, but as I'm sure you know, all too often, the effort peters out long before the project reaches any sort of maturity.  Either the customer needs it yesterday, or the developer gets feed up the management BS that stands between him/her and doing things right.
&lt;/p&gt;&lt;p&gt;So I guess I'm saying that I'm dubious about the WWW approach to design, but that I think that it's been a very useful contributor the world of enterprise application design, and that I recognize that the things that I do on my way to an answer may not always be the most intuitive, but they are part of a honed process of randomness that is web development.  Just a thought…&lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/80.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/27/80.aspx</guid>
            <pubDate>Sun, 28 Oct 2007 06:10:29 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/27/80.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/80.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Domain in the Box Part 3</title>
            <category>Domain Objects</category>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/26/79.aspx</link>
            <description>&lt;p&gt;So how to handle contact info, do I make a "type level" domain object like an Emergency or Home, or do I save that sort of logical grouping for the Business layer. Truthfully I've already made up my mind. The domain layer I'm updating doesn't make any groupings, and here's why. Essentially I tried to look at the domain objects as whole entities onto themselves. An email address really has nothing to do with a mailing address, and any association like "emergency" is purely a matter of interpretation. Another way to look at it is I didn't really want my domain layer making what I thought was a business decision to allow something like an emergency email. It's the prerogative of the BLL to decide what Types of each entity the system can created. Perhaps for the grouping of emergency the BLL determines that Phone-Number is the only valid entity to create and maintain. &lt;/p&gt;
&lt;p&gt;So if that sounds like a reasonable approach then it's not too hard to draw out where I'm going next. One change I've made though is to switch to Nullable&amp;lt;int&amp;gt;s for my IDs. I originally created this domain set in .Net 1.1 so that really wasn't a possibility. But now that I can, it can become a nice way to track new domain objects that must be persisted. This brings up a whole entire ball of scariness I haven't yet covered, how to track the dirty state of an Domain object, let me count the ways. First and foremost let me say that this is the sole potential benefit that I see in using DataSets instead of Domain objects, but it's not worth it by any means. &lt;/p&gt;
&lt;p&gt;Handling the notion of a Dirty object, is a touchy one topic, both because it can provide a fair number of challenges, and because there are so many preferred patterns to use. However generally I tend to cheat here especially when it comes to making any decision about whether to persist/update/delete a domain object I rely solely on the BLL to make the call. Because I generally try to follow a pattern where any UI, or API that can create or modify data has absolutely no contact with domain objects, I can push any state logic out of the domain layer allowing for a very simple model. I can't say if this is the best model, only that I like idea that a least one application layer can be very simple. &lt;/p&gt;
&lt;p&gt;So without further ado here's the ContactInfo Class and its constituents: &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ContactInfo &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? ContactInfoID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;PhoneNumber&lt;/span&gt;&amp;gt; PhoneNumbers { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;Address&lt;/span&gt;&amp;gt; Addresses { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;EmailAddress&lt;/span&gt;&amp;gt; EmailAddresses { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; ContactInfo() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; ContactInfo(&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? contactInfoID, &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;PhoneNumber&lt;/span&gt;&amp;gt; phoneNumbers, &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;Address&lt;/span&gt;&amp;gt; addresses, &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;EmailAddress&lt;/span&gt;&amp;gt; emailAddresses) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.ContactInfoID = contactInfoID; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.PhoneNumbers = phoneNumbers; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Addresses = addresses; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.EmailAddresses = emailAddresses; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;EmailAddress &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? AddressID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Address { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Status&lt;/span&gt; Status { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; Order { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; EmailAddress() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; EmailAddress(&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? addressID, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; address, &lt;span style="COLOR: #2b91af"&gt;Status&lt;/span&gt; status, &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; order) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.AddressID = addressID; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Address = address; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Status = status; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Order = order; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;}&lt;/span&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PhoneNumber &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? PhoneNumberID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Number { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PhoneNumberType&lt;/span&gt; PhoneNumberType { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; PhoneNumber() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; PhoneNumber(&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? phoneNumberID, &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; number, &lt;span style="COLOR: #2b91af"&gt;PhoneNumberType&lt;/span&gt; phoneNumberType) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.PhoneNumberID = phoneNumberID; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Number = number; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.PhoneNumberType = phoneNumberType; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Address &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? AddressID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;AddressType&lt;/span&gt; AddressType { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Street { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; City { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; State { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Zip { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; Address() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; Address(&lt;span style="COLOR: blue"&gt;int&lt;/span&gt;? addressID, &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;AddressType&lt;/span&gt; addressType, &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; street, &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; city, &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; state, &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; zip) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.AddressID = addressID; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.AddressType = addressType; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Street = street; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.City = city; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.State = state; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Zip = zip; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;That's it not too much there, but next we'll look at the Roles side of the Person Tree. &lt;/p&gt;
&lt;p&gt;Okay one more distraction, although I'm not yet focusing on unit tests, I'm going to include some code that I often use to support my unit tests. This class is used to create a default instance of a complex object. With my current code base I don't have a lot of use for it, but I'd like to throw it out there as I know it will be useful to me later, and hopefully someone will be able to turn it into something much more useful. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Object Creator &lt;/strong&gt;&lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DefaultObjectCreator&lt;/span&gt;&amp;lt;T&amp;gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; DefaultObjectCreator() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (_propertyValues == &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;_propertyValues = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Hashtable&lt;/span&gt;(); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;_objectType = &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(T); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DefaultObjectCreator&lt;/span&gt;&amp;lt;T&amp;gt; CreateObject() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;Assembly&lt;/span&gt; asm = &lt;span style="COLOR: #2b91af"&gt;Assembly&lt;/span&gt;.GetAssembly(_objectType); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&amp;gt; args = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&amp;gt;(); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;ConstructorInfo&lt;/span&gt; ctor = selectConstructor(_objectType); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;null&lt;/span&gt; == ctor) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;throw&lt;/span&gt; &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"Could not match provided parameters to any Constructor"&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;ParameterInfo&lt;/span&gt; pi &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; ctor.GetParameters()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (_propertyValues.ContainsKey(pi.Name)) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;args.Add(_propertyValues[pi.Name]); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;else &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;args.Add(getDefaultTypeValue(pi.ParameterType)); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;_createdObject = (T)asm.CreateInstance(_objectType.FullName, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;BindingFlags&lt;/span&gt;.CreateInstance, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, args.ToArray(), &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DefaultObjectCreator&lt;/span&gt;&amp;lt;T&amp;gt; SetValue(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; paramName, &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; value) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;null&lt;/span&gt; == _createdObject) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;_propertyValues[paramName] = value; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;PropertyInfo&lt;/span&gt; pi &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; _objectType.GetProperties()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (pi.Name.ToLower() == paramName.ToLower()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;pi.SetValue(_createdObject, value, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;FieldInfo&lt;/span&gt; fi &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; _objectType.GetFields()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (fi.Name.ToLower() == paramName.ToLower()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;fi.SetValue(_createdObject, value); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;throw&lt;/span&gt; &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="COLOR: #a31515"&gt;"Could not find property [{0}]"&lt;/span&gt;, paramName)); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; T GetObject() &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;null&lt;/span&gt; == _createdObject) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;CreateObject(); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; _createdObject; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ConstructorInfo&lt;/span&gt; selectConstructor(&lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt; objectType) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;ConstructorInfo&lt;/span&gt;[] ctors = objectType.GetConstructors(); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (_propertyValues.Count == 0) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;ConstructorInfo&lt;/span&gt; ctor &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; ctors) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (ctor.GetParameters().Length == 0) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; ctor; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;ConstructorInfo&lt;/span&gt; ctor &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; ctors) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (ctor.GetParameters().Length &amp;lt; _propertyValues.Count) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;continue&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt; found = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;string&lt;/span&gt; paramName &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; _propertyValues.Keys) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;ParameterInfo&lt;/span&gt; pi &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; ctor.GetParameters()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (pi.Name.ToLower() == paramName.ToLower()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;found = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;break&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (!found) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;continue&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (found) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; ctor; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; getDefaultTypeValue(&lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt; paramType) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (paramType == &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;)) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (paramType == &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;)) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;.MinValue; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (paramType.IsValueType) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (paramType.IsEnum) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Enum&lt;/span&gt;.GetValues(paramType).GetValue(0); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;else&lt;/span&gt; &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (paramType.IsPrimitive) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; 0; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; createDefaultObject(paramType); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; createDefaultObject(&lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt; objectType) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;Assembly&lt;/span&gt; asm = &lt;span style="COLOR: #2b91af"&gt;Assembly&lt;/span&gt;.GetAssembly(objectType); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&amp;gt; args = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;&amp;gt;(); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;ConstructorInfo&lt;/span&gt;[] ctors = objectType.GetConstructors(); &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;foreach&lt;/span&gt; (&lt;span style="COLOR: #2b91af"&gt;ParameterInfo&lt;/span&gt; pi &lt;span style="COLOR: blue"&gt;in&lt;/span&gt; ctors[0].GetParameters()) &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;args.Add(getDefaultTypeValue(pi.ParameterType)); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt; asm.CreateInstance(objectType.FullName, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;BindingFlags&lt;/span&gt;.CreateInstance, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, args.ToArray(), &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;); &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Hashtable&lt;/span&gt; _propertyValues; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; T _createdObject; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt; _objectType; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/79.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/26/79.aspx</guid>
            <pubDate>Sat, 27 Oct 2007 05:47:07 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/26/79.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/79.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Domain in the Box Part 2</title>
            <category>Domain Objects</category>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/25/78.aspx</link>
            <description>&lt;p&gt;*** Note I'm doing this post series using &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;Orcas Beta2&lt;/a&gt;. So most of my code samples will be using whatever new baked in goodness I can garner from new VS. So far I'm really amazed with this release of VS 2008, aside from awesome JavaScript Intellisense, and a generally lighter, faster feel, the big thing for me is that the 2 Deal Breaker issues I've had with the VS Unit Testing facilities have been fixed. As A long time &lt;a href="http://www.testdriven.net/"&gt;TestDriven.Net&lt;/a&gt; user, It was an absolute requirement to have a right click Run Tests, that would either execute a full TestFixture or single Test based on Context. Second was the ability to double click on the Error output and go straight to the line of Code that barfed. Glory be, they are both fixed (I always thought of them as bugs, not missing features), and I now am sold on the VS way, I am not worthy… &lt;/p&gt;
&lt;p&gt;The first part of the Plebian U domain I want to work through is the "person." I want to see if it's possible to encapsulate the full range of Employees and Students into a single object. I'm pursing this for my model as for the most part employees do not differ from students until the business logic layer. Sure employees get a salary or wage, and students pay tuition, but those are either actions of the University or students, not attributes of a person. &lt;/p&gt;
&lt;p&gt;There are differences to be sure, but I think that I can encapsulate those within the bounds of a Role object. This allows me to define a person who has 0-n Roles, and not have to maintain separate objects to represent the same actual person. Another key constraint I'm placing on myself is that I'm not going to be using Interfaces. This is partly to help maintain as simple of a structure as possible, and partly because I'm not worried about things like lazy loading or late binding. In general those are very useful considerations for a large application, but my overriding principle here is to have something I can very quickly customize to my current needs, without getting hung up on things like Versioning or configuration headaches that go hand in hand with those wonderful runtime typed domains. &lt;/p&gt;
&lt;p&gt;So I'm going to start by trying to identify everything that I think all employees and students have in common: &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Names – First, Last and Middle&amp;lt;opt&amp;gt; &lt;/li&gt;
    &lt;li&gt;Date Of Birth &lt;/li&gt;
    &lt;li&gt;Unique Id – something the student/employee can use on forms (often this is an SSN, but I'm thinking more generic) &lt;/li&gt;
    &lt;li&gt;Status – Active, Inactive or Current/Former, I see the roll object distinguishing Full-Time or Part-Time &lt;/li&gt;
    &lt;li&gt;Addresses – Mailing, Home, Billing, Emergency, other, &lt;/li&gt;
    &lt;li&gt;Phone-Numbers – Residence, Cell, Work, Emergency &lt;/li&gt;
    &lt;li&gt;Email Addresses – Personal, Work, Emergency &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What about the differences, like the students' grades, or class schedule, or a professor's class schedule or Start Date? Those are all really just other Domain objects. Employees will have an EmployeeRecord, and students will have things like an EnrollmentRecord, CurrentSchedule, and Transcript. By keeping things simple like this I'm getting at least 2 benefits, first is the ability to have my domain follow a reasonable pattern of normalization, and second Flexibility. If I create a Person with Roles, and Contact info, and basic Bio info, I can use that person object in an application for say a Gym. A person really is just a person, and it's useful not to clutter the domain with specifics that are not really necessary. It should be the Data not the format that tells us what we need. &lt;/p&gt;
&lt;p&gt;Say I was making an application for an auto dealer. One of the objects I certainly have is a Car. It wouldn't make much sense to track something like "SellerID" as a property of the Car, it's totally unrelated. The same applies to our Person. A Person can do and posses many things, but neither the Actions, nor the Possession are actual properties of the Person. &lt;/p&gt;
&lt;p&gt;One thing I've done thought is decided that I want to encapsulate a Person's Addresses, Phone-Numbers and Email Address as ContactInfo. It's a natural division, partly following the idea above, and partly violating it. Since the U cannot have a Person without some ability to contact them, it's fair to make it a property of the Person. Yet as both a nod to flexibility and separation of Domains, I see benefit in pulling it off as its own group. I may be totally wrong about this, but here's how I see my person domain object. &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;&amp;lt;T&amp;gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; PersonID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PersonReadableID&lt;/span&gt;&amp;lt;T&amp;gt; ReadableID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Status&lt;/span&gt; Status { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;PersonRole&lt;/span&gt;&amp;gt; Roles { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ContactInfo&lt;/span&gt; ContactInfo { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; FirstName { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; MiddleName { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; LastName { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;? BirthDate { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;Some things to note: &lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: Courier New"&gt;Status &lt;/span&gt;is an Enum; &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;PersonReadableID&lt;/span&gt;&amp;lt;T&amp;gt; &lt;/span&gt;will likely die an untimely death, I'm looking for a way to give a person a unique ID like an SSN, that we can persist with the person Record, and this gets me that for now, but I don't like it too much; &lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;PersonRole&lt;/span&gt;&amp;gt; &lt;/span&gt;is a placeholder, I haven't gotten to Roles yet, but I know I need them; &lt;span style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: Courier New"&gt;ContactInfo &lt;/span&gt;is also mostly just a stub, but here's a look at where I think I'm going. &lt;/p&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ContactInfo &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; ContactInfoID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;PhoneNumber&lt;/span&gt;&amp;gt; PhoneNumbers { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;Address&lt;/span&gt;&amp;gt; Address { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PhoneNumber &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; PhoneNumberID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Number { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;PhoneNumberType&lt;/span&gt; PhoneNumberType { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Address &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;{ &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; AddressID { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;AddressType&lt;/span&gt; AddressType { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Street { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; City { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; State { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; Zip { &lt;span style="COLOR: blue"&gt;get&lt;/span&gt;; &lt;span style="COLOR: blue"&gt;set&lt;/span&gt;; } &lt;/span&gt;&lt;br /&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;} &lt;/span&gt;&lt;br /&gt;
&lt;p&gt;With the Contact Info I'm not sure how I want to enforce grouping. IE should an Emergency Phone-Number and Address be treated as a single unit, or should it be the responsibility of the BLL to extract that info on demand, but that's for a later post, I've got some code, and some unit tests (won't bother posting most of those as they're very plain at this point).&lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/78.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/25/78.aspx</guid>
            <pubDate>Fri, 26 Oct 2007 05:36:43 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/25/78.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/78.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Domain in the Box Part 1</title>
            <category>Domain Objects</category>
            <link>http://blogs.sftsrc.com/jeffm/archive/2007/10/24/77.aspx</link>
            <description>&lt;p&gt;This post series is going to cover the creation of a fairly simple creation of a set of Domain objects to cover the needs of a fictional Plebian University.  The goal will be to create a set of Domain objects that will service a "tracking system" that encapsulates the management of people and facilities for this university.  The set of posts will be centered on the Domain objects but we can't really fully develop those objects without knowing a little about how we want to approach persistence and how we want to handle business logic.
&lt;/p&gt;&lt;p&gt;Sure there are hundreds of examples of domain object creation, so why bother posting on it?  First because I need to update my canned &lt;a href="http://blogs.sftsrc.com/jeffm/archive/2007/10/19/Making-the-most-out-of-the-AjaxControlToolkits-ModalPopupExtender-Part.aspx"&gt;library&lt;/a&gt;.  Second because I want to take a deeper look at some of the stuff coming up in .Net 3.5.  Third because a lot of the examples use the Customer/Order/OrderDetail problem set, and while that set is rich, I think there's a little more complexity to be had in the classification of a scholastic institution.  And lastly, well because the point of a blog isn't necessarily always to have all the answers, rather sometimes it's about testing yourself.  Key to that notion is that I've always been a Web-Developer, at least at heart, and one of the big implications of that is the tendency to start the design process from the point of view of what the UI can possibly do.  In this case I really am going to try to stick to a true domain level mapping of my problem set, and not get bogged down to heavily in how I'm going to deal with the problems from the UI.
&lt;/p&gt;&lt;p&gt;One of the problems I like that the scholastic model presents is how to handle professors who are students, or students that are employees.  From a persistence (DB) level it's pretty easy to see a Person store, and a PersonRole store that allows multiple Roles per Person.   In the domain level I can choose to split these out into firm types, or more closely model the persistence layer waiting until the business object layer to make any distinction.  However we decided to cover that ground I want to make sure I can explain my reasons in plain English such that my fictional End Users will be able to comprehend both the correctness and implications of my choices.
&lt;/p&gt;&lt;p&gt;Another good problem is the idea of forced generalization.  Consider that a common scenario in our fictional university is the temporary repurposing of facilities.  Say a classroom that is being used for chair storage.  I need to be able to represent this room both as a classroom and as a storage room, so something like the Roles classification system seems logical, but what about rooms that are multipurpose such as storage and rehearsal space.  Or facilities that need to be reclassified solely on the basis of its current occupant like a yoga studio that's also a creative writing classroom and Daycare playroom.   How are we going to represent this type of flexibility while still providing a meaningful representation of the universities facilities, what's the role of the Domain and what's really a Business Logic Layer decision, these are the types of questions I want to answer.
&lt;/p&gt;&lt;p&gt;The other part of this series of posts is to help layout and examine the evolution of requirements.  Anyone with at least one project under their belt will know the humor found in the schedule marker "Requirements Complete".  To the best of my knowledge, there has never been nor ever will be a "requirements complete" state for any business software project.  For this post series I want to have an informal approach to requirements.  There'll be some high level requirements, but in general we won't flush them out until we're in a specific problem space.   Also the requirements will be focused on the Application level and not on the Domain.  Partly that's to make their expansion somewhat realistic, and partly to allow me to be vague in laying them out. 
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Requirements:&lt;/strong&gt;
	&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The final Application needs to track all students and staff, full-time and part-time, exempt and non-exempt, current and former.
&lt;/li&gt;&lt;li&gt;The final Application needs to track all Colleges, both enrollment, usage of facilities, staff, and students who's major's fall into that college and students fulfilling requirements
&lt;/li&gt;&lt;li&gt;The final Application needs to track all facilities, both buildings and grounds.
&lt;/li&gt;&lt;li&gt;The final Application needs to track on campus student housing needs.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Okay seems simple enough.  The plan is to break off each Domain object by itself, with some exceptions like Person and PersonRole type groupings.  Hopefully when this is done there'll be a nice set of domain objects we can use for future sample projects.  And the next set of posts will be consuming these objects in Business Logic Layer.
&lt;/p&gt;&lt;img src="http://blogs.sftsrc.com/jeffm/aggbug/77.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Mayeur</dc:creator>
            <guid>http://blogs.sftsrc.com/jeffm/archive/2007/10/24/77.aspx</guid>
            <pubDate>Thu, 25 Oct 2007 05:14:35 GMT</pubDate>
            <comments>http://blogs.sftsrc.com/jeffm/archive/2007/10/24/77.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.sftsrc.com/jeffm/comments/commentRss/77.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>