<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Matei's blog</title>
    <description>Confessions of Mort</description>
    <link>http://blogs.aedigital.com/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-CA</language>
    <blogChannel:blogRoll>http://blogs.aedigital.com/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Matei Dorobantu</dc:creator>
    <dc:title>Matei's blog</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/MateisBlog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Bing maps web service weirdness</title>
      <description>&lt;p&gt;I’ve experienced some interesting issues with the Bing Maps web services, specifically the token service. Looks like it’s been a problem for some folks, and this time Google produced no conclusive results.&lt;/p&gt;  &lt;p&gt;The symptoms are that despite entering your account id and password correctly you cannot add a Web Service reference from VS 2008. You get an error message similar to this:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;There was an error downloading '&lt;/strong&gt;&lt;/em&gt;&lt;a href="https://staging.common.virtualearth.net/find-30/common.asmx?wsdl'"&gt;&lt;em&gt;&lt;strong&gt;https://staging.common.virtualearth.net/find-30/common.asmx?wsdl'&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;strong&gt;.        &lt;br /&gt;The request failed with HTTP status 400: Bad Request.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I’ve tried this on several machines with the same result. Hitting the site via IE works fine. Normally you have the option of using wsdl.exe/svcutil.exe and generating your proxy and this is what I normally use for web services. In this case that doesn't work well since my project is a Compact Framework project. The usual tools don’t seem to do the job, there is no switch that allows to specify the target framework as Compact Framework.&lt;/p&gt;  &lt;p&gt;The trick that worked for me was to download the .wsdl as common.wsdl and serve this file from my Web Development Server. Once this is set up, you can go ahead and add the Web Service reference from VS and point to this locally hosted common.wsdl. This should allow you to generate a web service proxy for the token service.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/n9TSIVgwIE4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/n9TSIVgwIE4/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/07/07/Bing-maps-web-service-weirdness.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=e965b706-1e10-461f-a2b6-458cb896dd7f</guid>
      <pubDate>Tue, 07 Jul 2009 16:27:18 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=e965b706-1e10-461f-a2b6-458cb896dd7f</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=e965b706-1e10-461f-a2b6-458cb896dd7f</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/07/07/Bing-maps-web-service-weirdness.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=e965b706-1e10-461f-a2b6-458cb896dd7f</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=e965b706-1e10-461f-a2b6-458cb896dd7f</feedburner:origLink></item>
    <item>
      <title>Some more shots</title>
      <description>&lt;p&gt;A few more shots I’ve taken over the past few weeks. The first one is in Vancouver, where I just missed ALT .Net. It was amazing how crowded the bay was, the weather was fantastic and there were quite a few sailboats about.&lt;/p&gt;  &lt;p&gt;Next couple of shot at Calgary Farmer’s Market. I have a couple of more of the textured ones, there was a small shop selling a variety of items made of felt. The colors and textures were too much to resist.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.flickr.com/photos/16854747@N03/3677292218/"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="3677292218_dd014c24ca_b" border="0" alt="3677292218_dd014c24ca_b" align="left" src="http://blogs.aedigital.com/image.axd?picture=WindowsLiveWriter/Somemoreshots/712482B4/3677292218_dd014c24ca_b.jpg" width="244" height="164" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt; &lt;a href="http://www.flickr.com/photos/16854747@N03/3687737969/"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="3687737969_8e823ae448_b" border="0" alt="3687737969_8e823ae448_b" align="left" src="http://blogs.aedigital.com/image.axd?picture=WindowsLiveWriter/Somemoreshots/5B5A9A57/3687737969_8e823ae448_b.jpg" width="244" height="164" /&gt;&lt;/a&gt;   &lt;p&gt;&lt;a href="http://www.flickr.com/photos/16854747@N03/3687731991/"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="3687731991_fb6886ab3e" border="0" alt="3687731991_fb6886ab3e" align="left" src="http://blogs.aedigital.com/image.axd?picture=WindowsLiveWriter/Somemoreshots/3AD35AA5/3687731991_fb6886ab3e.jpg" width="244" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/f6yolQimttw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/f6yolQimttw/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/07/06/Some-more-shots.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=33b97298-c79f-4037-b568-19b2467ed5bd</guid>
      <pubDate>Mon, 06 Jul 2009 14:00:35 -1400</pubDate>
      <category>Photography</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=33b97298-c79f-4037-b568-19b2467ed5bd</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=33b97298-c79f-4037-b568-19b2467ed5bd</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/07/06/Some-more-shots.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=33b97298-c79f-4037-b568-19b2467ed5bd</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=33b97298-c79f-4037-b568-19b2467ed5bd</feedburner:origLink></item>
    <item>
      <title>Blown gasket</title>
      <description>&lt;p&gt;I have a ‘98 Subaru Legacy GT which has now developed the infamous head gasket issue. There’s 180K on the clock, and I just got back from Vancouver where I missed the ALT .Net conference due to a variety of mechanical failures. Ballpark figure around $2200 to make this go away. Who knows how bad the damage is, there is so much junk in the coolant now it’s hard to tell. I really like this car, but this is depressing. I need a 2005-2006 GT with a manual transmission, that’ll cheer me up.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/P0kPbKMuUng" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/P0kPbKMuUng/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/06/17/Blown-gasket.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=f298c74b-6210-407a-83e5-f6af171763a8</guid>
      <pubDate>Wed, 17 Jun 2009 09:41:22 -1400</pubDate>
      <category>Rants</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=f298c74b-6210-407a-83e5-f6af171763a8</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=f298c74b-6210-407a-83e5-f6af171763a8</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/06/17/Blown-gasket.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=f298c74b-6210-407a-83e5-f6af171763a8</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=f298c74b-6210-407a-83e5-f6af171763a8</feedburner:origLink></item>
    <item>
      <title>Some HDR shots</title>
      <description>&lt;p&gt;I’ve gotten a digital camera for my birthday from the wife – nothing too fancy, a Canon XS with the EFS 18-55 IS kit lens. I’ve been putting it through its paces lately, getting some practice with a variety of shots. A few weeks ago, I’ve found some pretty interesting shots on Flickr and it turns out it was &lt;a href="http://www.stuckincustoms.com/"&gt;Trey Ratcliff&lt;/a&gt;’s work. Needless to say I find his stuff pretty awesome. He’s got an &lt;a href="http://www.stuckincustoms.com/hdr-tutorial/"&gt;HDR tutorial&lt;/a&gt; that inspired me quite a bit, and after a few unsuccessful HDR attempts I came up with a pretty decent shot.&lt;/p&gt;  &lt;p&gt;This was taken around 8:15 PM at the Anderson train station in Calgary. Three exposures, +/-2 EV, from the tripod, with the kit lens. It’s the best one yet, although it has some ghosting and noise issues. I don’t really have a good noise reduction software.&lt;/p&gt;  &lt;p&gt;Here’s another one, from our living room. Three exposures, +/-2 EV apart, with the tripod and the EF 50 1.8 II. Pretty mundane subject, I’m trying to get the creative juices flowing and learn more about light.&lt;/p&gt;  &lt;p&gt;By the way, the EF 50 is absolutely amazing, scored it for 120 at Future Shop of all places and it’s worth every penny. It’s giving me some grief with the slow/noisy focus. The DOP is also very shallow, which makes certain shots tricky until you get used to it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.flickr.com/photos/16854747@N03/3523859899/in/set-72157617928833317/"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 0px; display: inline; border-top: 0px; border-right: 0px" title="_MG_2066_7_8" border="0" alt="_MG_2066_7_8" src="http://blogs.aedigital.com/image.axd?picture=_MG_2066_7_8.jpg" width="244" height="164" /&gt;&lt;/a&gt;&lt;a href="http://www.flickr.com/photos/16854747@N03/3524456144/in/set-72157617928833317/"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 10px; display: inline; border-top: 0px; border-right: 0px" title="_MG_2494_5_6" border="0" alt="_MG_2494_5_6" src="http://blogs.aedigital.com/image.axd?picture=_MG_2494_5_6.jpg" width="244" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/tCmi08UGZyM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/tCmi08UGZyM/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/05/11/Some-HDR-shots.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=c9374ac3-53ab-4fe6-aa39-cdccc97520e8</guid>
      <pubDate>Mon, 11 May 2009 15:29:09 -1400</pubDate>
      <category>Photography</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=c9374ac3-53ab-4fe6-aa39-cdccc97520e8</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=c9374ac3-53ab-4fe6-aa39-cdccc97520e8</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/05/11/Some-HDR-shots.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=c9374ac3-53ab-4fe6-aa39-cdccc97520e8</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=c9374ac3-53ab-4fe6-aa39-cdccc97520e8</feedburner:origLink></item>
    <item>
      <title>jQuery web service proxy</title>
      <description>&lt;p&gt;A little while back I was looking for a nice convenient way of calling ASP .Net web services from JavaScript. I looked at the MS Ajax implementation, however I’m a little uncomfortable with the Script Manager and all the related plumbing. It’s just a little heavy for my taste, and I’m not a big fan of the auto generated web service proxy. I also wanted to keep the door open for porting my project to Mono and I wasn’t sure if those features have been ported yet (if they have, ping me). I looked at jQuery, Prototype and Scriptaculous and of those three I liked jQuery the best for the additional features the package offers. Right off the bat jQuery was pretty simple to use and set up, but a little too much typing for my taste. Here’s what I came up with:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;(&lt;span class="kwrd"&gt;function&lt;/span&gt;($) { $.proxy = &lt;span class="kwrd"&gt;function&lt;/span&gt;(options) {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="rem"&gt;/* Default .Net web service proxy options. */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;var&lt;/span&gt; defaults = {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            mode: &lt;span class="str"&gt;&amp;quot;POST&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            contentType: &lt;span class="str"&gt;&amp;quot;application/json;charset=utf-8&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            dataType: &lt;span class="str"&gt;&amp;quot;json&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            endPoint: &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            data: &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            success: {},&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            failure: {}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        };&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="rem"&gt;/* Extend (or override) the defaults with any passed in options. I really like this extend feature. */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="kwrd"&gt;var&lt;/span&gt; options = $.extend(defaults, options);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="rem"&gt;/* Make the ajax call using $.ajax() */&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; $.ajax({&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            url: options.endPoint,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            type: options.mode,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            contentType: options.contentType,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;            dataType: options.dataType,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;            data: options.data,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;            success: options.success,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            error: options.failure&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        });&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;    };&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;})(jQuery);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This is a simple jQuery plug-in that encapsulate the details of calling ASP .Net web services. This is pretty sweet since now I can do something like this and avoid all that set-up work every time I need to call into the back-end:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;Zanzibar = {}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;Zanzibar.Web = {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    LocationService: {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        Get: &lt;span class="kwrd"&gt;function&lt;/span&gt;(options) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            $.extend(options, { endPoint: &lt;span class="str"&gt;&amp;quot;http://localhost:60088/RPC/GeoLocation.asmx/Get&amp;quot;&lt;/span&gt; });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;            &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; $.proxy(options);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;This becomes my proxy now. I’m extending the options with the specific end point for the web method I need to call and the usage pattern for this becomes something like the following:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;Zanzibar.Web.LocationService.Get({&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    data: &lt;span class="str"&gt;&amp;quot;{ userId: 10001 }&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    success: successCallback,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    failure: errorCallback&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;});&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;
This is great, because now all I need to worry about is the actual parameters I want to call my web service with, none of the setup work is needed up front anymore. Clearly other methods can be added and you can provide a really nice, rich wrapper for a web service this way. No complex inheritance, just some simple composition and extension of passed in parameters with some default settings. I really like the $.extend() function, comes in very handy for defaulting parameters and helping cut down on verbosity somewhat. Using that cool feature I can trim the code down but I still retain the power of customizing every aspect of my web service call if I need to.&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/WSuvW4BPsm8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/WSuvW4BPsm8/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/04/01/jQuery-web-service-proxy.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=f63b7065-92b8-45ff-902b-e10d74a2b095</guid>
      <pubDate>Wed, 01 Apr 2009 14:46:32 -1400</pubDate>
      <category>Web Services</category>
      <category>jQuery</category>
      <category>JavaScript</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=f63b7065-92b8-45ff-902b-e10d74a2b095</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=f63b7065-92b8-45ff-902b-e10d74a2b095</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/04/01/jQuery-web-service-proxy.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=f63b7065-92b8-45ff-902b-e10d74a2b095</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=f63b7065-92b8-45ff-902b-e10d74a2b095</feedburner:origLink></item>
    <item>
      <title>Sustainable development</title>
      <description>&lt;p&gt;Why is it that many development shops still do not practice agile? What makes adoption so slow even today after so many successful projects? There are countless evangelists out there preaching and demonstrating the practices yet it seems that the old ways of waterfall like development are anything but numbered. Even worse, there are plenty of shops out there that claim to practice agile, and ignore some of the most basic principles – first one that comes to mind is continuous improvement. Ever dodging that post mortem, perpetually avoiding those tough questions – are we delivering value to our customers? Is our software maintainable, flexible, can it respond to the clients rapidly changing needs, particularly in this difficult economic climate?&lt;/p&gt;  &lt;p&gt;A small startup will wither and die if they’d be providing these subpar services to their customers. Some large corporations, unfortunately, seem to benefit from inertia and continue to do business as usual. Are their customers not demanding enough? Do they continue supporting them in hope that one day they will get what they pay for? It can’t be the customers, after all our services haven’t been an astounding commercial success.&lt;/p&gt;  &lt;p&gt;I’m not even sure where this was going. Suffice to say I’m a string believer in sustainable development.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/M0Ff4a-j2O8" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/M0Ff4a-j2O8/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/03/31/Sustainable-development.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=20efaa71-03dc-42e7-992a-da7b1757d5f6</guid>
      <pubDate>Tue, 31 Mar 2009 00:14:46 -1400</pubDate>
      <category>Rants</category>
      <category>Agile</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=20efaa71-03dc-42e7-992a-da7b1757d5f6</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=20efaa71-03dc-42e7-992a-da7b1757d5f6</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/03/31/Sustainable-development.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=20efaa71-03dc-42e7-992a-da7b1757d5f6</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=20efaa71-03dc-42e7-992a-da7b1757d5f6</feedburner:origLink></item>
    <item>
      <title>TDD and I</title>
      <description>&lt;p&gt;   &lt;p&gt;This is a re-take of one of my posts to the ALT.Net Google group. Probably a little of topic so I just want to capture it here, for future reference.&lt;/p&gt;    &lt;p&gt;I'd like to throw in my two cents. I'm a TDD noob, so it might be relevant in this context. The point of the lengthy story that follows is that you can only lead a horse to water, as one of my colleagues likes to say when we discuss taking over the office with TDD. If one is not open to exploring new ways of doing things and discounts it right off the bat, no progress will be made. You can cite all the papers in the world, studies and research and successful projects, give examples, they will all be attributed to flukes, better funding, better building, better chairs, etc. People naturally resist change, and it will be rationalized in new and interesting ways all the time. I think the gap is not something the &lt;a href="http://ALT.NET"&gt;ALT.NET&lt;/a&gt; community can bridge. Each developer must try it first hand to experience the benefits. And try hard, because it’s not easy. For me the TDD showdown happened privately, I was both the TDD-er and the non-TDD-er. &lt;/p&gt;    &lt;p&gt;That being said, big thanks go out to the folks on this board, and others, who’ve paved the way for me to become a better developer. I don’t think we’d be where we are now if it weren’t for huge contributions from guys like you. And for what it’s worth, I think the ALT.NET movement is doing a great job of moving forward the .Net world, and promoting continuous improvement. Read no further unless you have time for a rant.&lt;/p&gt;    &lt;p&gt;I've been trying to promote TDD at work for the past few months. I've spent a lot of my personal time actually doing it to get hands on experience, scoping out different open source projects to get a feel for it (good vs bad unit tests, mocking, etc.) Here's one of the things that struck me in the learning process. I've been reading a lot - generally I agree with the literature on the benefits of TDD, but I was somewhat skeptical about the practical aspects - and accumulating a lot of theoretical knowledge. Still, when time came to write my first test I felt none the wiser. Complete writer's block – huh, where do I start kind of thing? So I've stumbled and tried and Googled and things started working together. I was pretty happy with the way things were going. Then I ran into things that needed testing that were doing a bunch of file manipulations. Uh oh, very unpleasant, no interface in sight in the &lt;a href="http://System.IO"&gt;System.IO&lt;/a&gt; namespace so no mocking. Gave up on TDD. Time passed, and I got uncomfortable with the lack of feedback. Yes, that is when I realized first hand that TDD was giving me something other than a bunch of asserts I could run and tell that everything was ok. Started TDD again, wrote wrappers for the System.IO part and wrote some integration tests on top of the unit tests to verify the files are handled correctly (I’m still not sure if this was the way to go, but it works pretty well in practice) and I was happy again.&lt;/p&gt;    &lt;p&gt;A big moment for me was when I tried writing a validation framework. So I started with a little sketch of what I was trying to build. It had things like IRuleSet, IRule,IRuleResult and various implementations of those. Then I started coding, and wrote everything test first to see where it will lead. Well most of those things became superfluous. The problem I was trying to solve was much simpler – basically write a bunch of rules I could evaluate in a batch and tell a remote client everything that was wrong with their request in one remote call. Ultimately I just kept the IRuleSet&amp;lt;T&amp;gt; and expressed the rules as simple lambda’s that would return true or false. So I can do things like this:&lt;/p&gt;    &lt;div&gt;     &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;       &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; IRuleSet&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; rules = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RuleSet&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;

      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; rules.Add(x =&amp;gt; x.Length &amp;gt; 5, “Length must be greater than 5”)&lt;/pre&gt;

      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     .Add(x =&amp;gt; x.Length &amp;lt; 10, “Length must be less than 10”)&lt;/pre&gt;

      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     .Add(x =&amp;gt; x.Contains(&lt;span style="color: #006080"&gt;&amp;quot;TDD&amp;quot;&lt;/span&gt;), &lt;span style="color: #006080"&gt;&amp;quot;Must contain TDD&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

      &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; List&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; brokenRules = rules.RulesBrokenBy (“TDD Rocks!”);&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;I liked this better than the objects soup I initially cooked up, and it works very well with some caveats. I’m sure that this would have taken a lot longer to achieve without the TDD approach, as it made me realize what my real requirements were, and that I didn’t need all that complexity I was imagining in the beginning.&lt;/p&gt;

  &lt;p&gt;Lots more tests have been written since and lots more code. The overall quality has improved and getting better every day. It is however a process of continuous improvement and it takes work. It would be hard now to turn back and do thing the old fashion way. The one thing I could have used is a good mentor to provide some guidance. Failing that, I turned to ALT.NET and the huge contributions made by the members, and it’s helped in more ways than I can describe. Thanks again to everyone that uses their free time to contribute and guide other devs! Kudos! Sorry for the rant, and slightly off topic post.&lt;/p&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/uQsKbwX5z60" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/uQsKbwX5z60/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/03/30/TDD-and-I.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=e2ce2de8-6a19-445b-b5d8-c61dceed539b</guid>
      <pubDate>Mon, 30 Mar 2009 08:21:26 -1400</pubDate>
      <category>Rants</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=e2ce2de8-6a19-445b-b5d8-c61dceed539b</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=e2ce2de8-6a19-445b-b5d8-c61dceed539b</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/03/30/TDD-and-I.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=e2ce2de8-6a19-445b-b5d8-c61dceed539b</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=e2ce2de8-6a19-445b-b5d8-c61dceed539b</feedburner:origLink></item>
    <item>
      <title>Changed theme</title>
      <description>&lt;p&gt;I was looking for a cool blog theme and I found a couple I liked. They make code look pretty crappy though, particularly longer lines in .config files and the like.I’ve decided that I’ll go back to Cogitation. Looks decent, and is very practical for showing code.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/bmOTR_Rh0s4" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/bmOTR_Rh0s4/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/03/29/Changed-theme.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=7802aa52-067d-4372-b825-b805da56c862</guid>
      <pubDate>Sun, 29 Mar 2009 12:45:15 -1400</pubDate>
      <category>Rants</category>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=7802aa52-067d-4372-b825-b805da56c862</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=7802aa52-067d-4372-b825-b805da56c862</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/03/29/Changed-theme.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=7802aa52-067d-4372-b825-b805da56c862</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=7802aa52-067d-4372-b825-b805da56c862</feedburner:origLink></item>
    <item>
      <title>Jeremy Miller on Persistence Patterns</title>
      <description>&lt;p&gt;Remember that article on persistence patterns I promised a while ago? Well, &lt;a href="http://codebetter.com/blogs/jeremy.miller/"&gt;Jeremy Miller&lt;/a&gt; beat me to the punch (which comes as no surprise, since despite my efforts I only post once in a blue moon). Check out his MSDN article &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2009/03/24/persistence-patterns-in-msdn-magazine.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I’ve been fighting other battles in the mean time, with some success. More on that later.&lt;/p&gt;  &lt;p&gt;Cheers,&lt;/p&gt;  &lt;p&gt;Matei&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/hfZE-bIfeBY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/hfZE-bIfeBY/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2009/03/26/Jeremy-Miller-on-Persistence-Patterns.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=c6c18e24-6712-4a58-927d-f03fbb9390a6</guid>
      <pubDate>Thu, 26 Mar 2009 14:43:29 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=c6c18e24-6712-4a58-927d-f03fbb9390a6</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=c6c18e24-6712-4a58-927d-f03fbb9390a6</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2009/03/26/Jeremy-Miller-on-Persistence-Patterns.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=c6c18e24-6712-4a58-927d-f03fbb9390a6</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=c6c18e24-6712-4a58-927d-f03fbb9390a6</feedburner:origLink></item>
    <item>
      <title>Cold!</title>
      <description>&lt;p&gt;Oh boy is it cold out there! It was pretty insane out there today, about –40 with the windshield. We used to have a joke in Romania that goes like this:&lt;/p&gt;  &lt;p&gt;What’s the difference between Canada and Siberia?   &lt;br /&gt;You go to Canada by you own free will!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/1lhsb5_8R0M" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/1lhsb5_8R0M/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2008/12/15/Cold!.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=28827bea-5192-4f65-a1d0-33cfc57441b8</guid>
      <pubDate>Mon, 15 Dec 2008 15:06:43 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=28827bea-5192-4f65-a1d0-33cfc57441b8</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=28827bea-5192-4f65-a1d0-33cfc57441b8</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2008/12/15/Cold!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=28827bea-5192-4f65-a1d0-33cfc57441b8</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=28827bea-5192-4f65-a1d0-33cfc57441b8</feedburner:origLink></item>
    <item>
      <title>Template expansion with nAnt</title>
      <description>&lt;p align="left"&gt;If you have a nAnt driven build system, or are planning on putting one together, template expansion can be a very useful tool. It helps you account for variability in the build environment, be it on developer machines or the build server. I’ve posted a couple of links before for nAnt, (&lt;a href="http://www.jpboodhoo.com/blog/NAntStarterSeries.aspx"&gt;see JP’s excellent tutorial series&lt;/a&gt;) but this one keeps coming up so I figured I’d dedicate a post to it.&lt;/p&gt;  &lt;p align="left"&gt;You can simply define properties in your build file and .config templates (or other templates) with tokens to be replaced with property values. When you copy the template file over, the tokens can be replaced by their respective property values, using the filterchain feature.&lt;/p&gt;  &lt;p&gt;Here’s a very simple file that doesn’t do much besides copy a .config file over to the deploy folder and expand the tokens in it; right below it there is a section of the web.config.template we will use;&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;?xml version=&lt;span style="color: #006080"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;?&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;project name=&lt;span style="color: #006080"&gt;&amp;quot;eploringormpatterns&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &amp;lt;property name=&lt;span style="color: #006080"&gt;&amp;quot;connection.string&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;&amp;quot;Data Source=ARES;Initial Catalog=ormpatterns;Integrated Security=True&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;   &amp;lt;target name=&lt;span style="color: #006080"&gt;&amp;quot;expand.template&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;default&lt;/span&gt;=&lt;span style="color: #006080"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &amp;lt;copy file=&lt;span style="color: #006080"&gt;&amp;quot;src\web\web.config.template&amp;quot;&lt;/span&gt; tofile=&lt;span style="color: #006080"&gt;&amp;quot;deploy\web\web.config&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;       &amp;lt;filterchain&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         &amp;lt;replacetokens&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;           &amp;lt;token key=&lt;span style="color: #006080"&gt;&amp;quot;connection.string&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;&amp;quot;${connection.string}&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         &amp;lt;/replacetokens&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;       &amp;lt;/filterchain&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     &amp;lt;/copy&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;   &amp;lt;/target&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &amp;lt;/project&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;?xml version=&lt;span style="color: #006080"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;?&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;configuration&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &amp;lt;connectionStrings&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &amp;lt;add name=&lt;span style="color: #006080"&gt;&amp;quot;ormpatterns&amp;quot;&lt;/span&gt; connectionString=&lt;span style="color: #006080"&gt;&amp;quot;@connection.string@&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         providerName=&lt;span style="color: #006080"&gt;&amp;quot;System.Data.SqlClient&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;   &amp;lt;/connectionStrings&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &amp;lt;/configuration&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;When you run this build file the web.config.template file will be copied over to “deploy\web\web.config” and the @connection.string@ token will be replaced with the value in the property with the same name.&lt;/p&gt;

&lt;p&gt;It would be nice if we didn’t need to touch the .build file every time we needed to customize a property. Well, there’s a way to do that. We can extract the properties that vary in a separate file, say local.settings.xml and include that in the build file. That way we only need to change a tiny file to make the build run in our environment. We end up with something like the file below:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;?xml version=&lt;span style="color: #006080"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span style="color: #006080"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt; ?&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;properties&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &amp;lt;property name=&lt;span style="color: #006080"&gt;&amp;quot;connection.string&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;=&lt;span style="color: #006080"&gt;&amp;quot;Data Source=ARES;Initial Catalog=ormpatterns;Integrated Security=True&amp;quot;&lt;/span&gt; /&amp;gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &amp;lt;/properties&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;and in the build file we include the local.settings.xml file like so:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;include buildfile=&lt;span style="color: #006080"&gt;&amp;quot;local.settings.xml&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now we have one simple file to edit in order to account for changes in the environment and we never have to touch the build file for small changes.&lt;/p&gt;

&lt;p&gt;On a final note, when setting up your nAnt build system, try to avoid folders with spaces in the name. This will save you much pain and suffering,&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/lnXy4PKBlF0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/lnXy4PKBlF0/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2008/12/15/Template-expansion-with-nAnt.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=4c1997a3-93c7-4aef-9101-e5fc27ac28b4</guid>
      <pubDate>Mon, 15 Dec 2008 14:59:02 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=4c1997a3-93c7-4aef-9101-e5fc27ac28b4</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=4c1997a3-93c7-4aef-9101-e5fc27ac28b4</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2008/12/15/Template-expansion-with-nAnt.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=4c1997a3-93c7-4aef-9101-e5fc27ac28b4</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=4c1997a3-93c7-4aef-9101-e5fc27ac28b4</feedburner:origLink></item>
    <item>
      <title>Data types and you</title>
      <description>&lt;p&gt;I promised myself I’ll stop posting trivialities, but I feel compelled to discuss double versus decimal again. I see a lot of people use double or float for money amounts. Don’t! Double, or float for that matter, doesn’t have enough precision to handle financial calculations without a lot of rounding errors. The decimal data type provides significantly more precision than the other two. So if you are wondering where those pennies went, well it’s time to switch to decimal.&lt;/p&gt;  &lt;p&gt;You should know that there are some performance penalties associated with this, as it is a 128 bit value. Also, ran into an interesting detail in the docs: the decimal struct is not guaranteed to be thread safe on all platforms! What gives? Apparently the value is too large to be assigned in one atomic operation. Does anyone know more about the mechanics of this? Please share!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/yTavfy82pDU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/yTavfy82pDU/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2008/12/10/Data-types-and-you.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=99aa9b41-6a34-406e-a326-9670a75fa9de</guid>
      <pubDate>Wed, 10 Dec 2008 15:29:23 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=99aa9b41-6a34-406e-a326-9670a75fa9de</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=99aa9b41-6a34-406e-a326-9670a75fa9de</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2008/12/10/Data-types-and-you.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=99aa9b41-6a34-406e-a326-9670a75fa9de</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=99aa9b41-6a34-406e-a326-9670a75fa9de</feedburner:origLink></item>
    <item>
      <title>Structs and interfaces</title>
      <description>&lt;p&gt;I ran into an interesting tidbit the other day: a couple of structs implementing and interface. That just seems like asking for trouble to me, structs are value types and interfaces are reference types. Something tells me there could be some subtle issues associated with this. It’s pretty clear that boxing will occur when you pass a value type as a reference type, but I’m sure that’s not the only issue we’ll see here. Time for a quick study.&lt;/p&gt;  &lt;p&gt;Here’s the interface we’ll be implementing:&lt;/p&gt;  &lt;div&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IPlayer&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name { get; set; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Club { get; set; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Age { get; set; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Transfer(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; newClub);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And here’s a real simple implementation for it:&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;struct&lt;/span&gt; Player : IPlayer&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name { get; set; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; club;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Club&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; club; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;         set { club = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Age { get; set; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Transfer(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; newClub)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;         club = newClub;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;So we’re just going to go ahead and create an instance of a player. Once we have that we’ll print the club he’s currently playing for and we’ll transfer him to a different club (and make a lot of money in the process).&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; Player player = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Player {Age = 20, Club = &lt;span style="color: #006080"&gt;&amp;quot;AC Milan&amp;quot;&lt;/span&gt;, Name = &lt;span style="color: #006080"&gt;&amp;quot;Marco van Basten&amp;quot;&lt;/span&gt;};&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; player.Transfer(&lt;span style="color: #006080"&gt;&amp;quot;Ajax Amsterdam&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; Console.WriteLine(player.Club);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;It’s not too hard to guess this will output “Ajax Amsterdam”. Now what happens if we transfer Marco back to AC Milan, but using the IPlayer interface now? Let’s see.&lt;/p&gt;

&lt;div&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; IPlayer copy = player;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; copy.Transfer(&lt;span style="color: #006080"&gt;&amp;quot;AC Milan&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; Console.WriteLine(player.Club);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Looks like Marco still plays for Amsterdam even though we&amp;#160; just transferred him to Milan. Tough! Well, what happened? The implicit cast created a temporary object we updated and threw away. Not good. Now if we changed the Player struct to a class it would all work as expected.&lt;/p&gt;

&lt;p&gt;I would stay away from structs implementing interfaces, just make it a class instead.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/wpA9eiD0Wek" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/wpA9eiD0Wek/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2008/12/09/Structs-and-interfaces.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=0bd621f2-734d-4b12-93ab-7f5a8d37d08f</guid>
      <pubDate>Tue, 09 Dec 2008 13:26:54 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=0bd621f2-734d-4b12-93ab-7f5a8d37d08f</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=0bd621f2-734d-4b12-93ab-7f5a8d37d08f</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2008/12/09/Structs-and-interfaces.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=0bd621f2-734d-4b12-93ab-7f5a8d37d08f</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=0bd621f2-734d-4b12-93ab-7f5a8d37d08f</feedburner:origLink></item>
    <item>
      <title>Back to basics - Intro</title>
      <description>&lt;p&gt;
After some though I came up with an idea on a multi-part article that I think will be useful. It will cover one aspect of programming I am currently struggling with at work - namely persistence.
&lt;/p&gt;
&lt;p&gt;
I believe, &lt;a href="http://ayende.com/blog/"&gt;as Ayende puts it&lt;/a&gt;, that the persistence problem has been solved. On my personal projects I use NHibernate with some very good success. It&amp;#39;s been hard-fought and I&amp;#39;m the first to admit there is quite the learning curve to it. But in the long run it&amp;#39;s worth it.
&lt;/p&gt;
&lt;p&gt;
At work, on the other hand, we use table gateways and we end up with reams of transaction scripts spread throughout the application. It is procedural programming disguised as objects, and the issues associated with it are numerous and a constant source of pain and suffering - at least for me. Code duplication is rampant, business logic is frequently implemented in stored procedures - which subsequently become un-usable in other areas of the application. A fair amount of logic is spread trough the code behind of pages and sometimes as orphan classes in the App_data folder of all places.
&lt;/p&gt;
&lt;p&gt;
I&amp;#39;ve spoken to a couple of colleagues about NHibernate and OR\M in general but there seems to be a disconnect somewhere. I suspect the issue is with a lack of understanding of the basic OR\M patterns that enable a rich domain model and encapsulate the complexities of persistence.
&lt;/p&gt;
&lt;p&gt;
This mini-series will be about basic OR\M patterns, and it&amp;#39;s intended to provide a side by side comparison of the options available to us - from hand rolled to meta data driven. I will try to demonstrate - with code, not just talk - the advantages and disadvantages of different patterns, hopefully evolving from one to the next organically, as the requirements become more complex. I have a feeling I&amp;#39;m under estimating this in more ways than one, but we&amp;#39;ll see where it goes.
&lt;/p&gt;
&lt;p&gt;
As always feedback is always welcome.
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/GLfnm5uE0YA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/GLfnm5uE0YA/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2008/11/27/Back-to-basics-Intro.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=715a585a-d1f7-484a-8ae8-bb1b865d9270</guid>
      <pubDate>Thu, 27 Nov 2008 06:53:00 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=715a585a-d1f7-484a-8ae8-bb1b865d9270</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=715a585a-d1f7-484a-8ae8-bb1b865d9270</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2008/11/27/Back-to-basics-Intro.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=715a585a-d1f7-484a-8ae8-bb1b865d9270</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=715a585a-d1f7-484a-8ae8-bb1b865d9270</feedburner:origLink></item>
    <item>
      <title>It's been a long time</title>
      <description>&lt;p&gt;It's been a while since I started this blog, and it's been a while since I've updated it with anything meaningful (if ever). Lots happened and I got caught up in the daily grind. We've had our second kid and that certainly doesn't help with free time to post on the blog.&lt;/p&gt;  &lt;p&gt;When I first started this blog I had some goals in mind. I've accomplished none. I am not very articulate in English (it is not my native language as you might have noticed) so I was hoping to improve on that. I was also hoping to share some of my ideas and experiences with you, the reader, since it is somewhat rare that I get to enjoy a free exchange of ideas; you know, talking to somebody who's ego is not larger that the known universe, and who knows what a bloody decorator is. That didn't work out at all, and it's probably due to the poor content I've offered so far. I will try to do better.&lt;/p&gt;  &lt;p&gt;It's somewhat difficult to decide what content is worth writing about because every other topic has been covered pretty well and in depth on a myriad other blogs. Also I find myself dealing with a lot of procedural code lately and who would be interested in that? In fact come to think of it, it is the pinnacle of procedural code, so there may be some value dissecting that. Along with the long list of antipatterns i've been exposed to lately - mostly the mushroom management comes to mind.&lt;/p&gt;  &lt;p&gt;More to come!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MateisBlog/~4/kG5r8Z1SarU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/MateisBlog/~3/kG5r8Z1SarU/post.aspx</link>
      <author>mateid.nospam@nospam.aedigital.com (mateid)</author>
      <comments>http://blogs.aedigital.com/post/2008/11/23/Its-been-a-long-time.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.aedigital.com/post.aspx?id=db173ad4-d7d7-4626-88af-db7519508990</guid>
      <pubDate>Sun, 23 Nov 2008 16:03:35 -1400</pubDate>
      <dc:publisher>mateid</dc:publisher>
      <pingback:server>http://blogs.aedigital.com/pingback.axd</pingback:server>
      <pingback:target>http://blogs.aedigital.com/post.aspx?id=db173ad4-d7d7-4626-88af-db7519508990</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://blogs.aedigital.com/trackback.axd?id=db173ad4-d7d7-4626-88af-db7519508990</trackback:ping>
      <wfw:comment>http://blogs.aedigital.com/post/2008/11/23/Its-been-a-long-time.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.aedigital.com/syndication.axd?post=db173ad4-d7d7-4626-88af-db7519508990</wfw:commentRss>
    <feedburner:origLink>http://blogs.aedigital.com/post.aspx?id=db173ad4-d7d7-4626-88af-db7519508990</feedburner:origLink></item>
  </channel>
</rss>
