<?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:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Devlicio.us - Just the Tasty Bits</title><link>http://devlicio.us/blogs/</link><description>Your Agile .NET Community</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Devlicious" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>A Follow-up to my Azure Panic Attack</title><link>http://feedproxy.google.com/~r/Devlicious/~3/_h56tXx8t9A/a-follow-up-to-my-azure-panic-attack.aspx</link><pubDate>Sun, 08 Nov 2009 21:25:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53525</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In &lt;a href="http://devlicio.us/blogs/rob_eisenberg/archive/2009/11/02/microsoft-what-is-the-meaning-of-this.aspx"&gt;this post&lt;/a&gt;, I panicked a bit about an email I received from The Azure Team ;)&amp;nbsp; In short, the email said that my storage account was going to be deleted on November 3rd if I didn&amp;rsquo;t migrate it to the new servers.&amp;nbsp; I received the email around 6pm on November 2nd.&amp;nbsp; Yikes! I feared that we might lose all of &lt;a href="http://www.silverarcade.com/"&gt;Silver Arcade&amp;rsquo;s&lt;/a&gt; assets.&amp;nbsp; After a bit of research, I discovered that I should have received a similar email warning me about this change several months ago. Something went wrong somewhere, somehow. In any case, I managed to get all of our data backed up using &lt;a href="http://www.cerebrata.com/Products.aspx"&gt;Cloud Storage Studio&lt;/a&gt; which &lt;a href="http://blogs.silverarcade.com/silverlight-games-101/"&gt;Bill Reiss&lt;/a&gt; had recommended to me.&amp;nbsp; While I was doing this, I was frantically trying to get into contact with someone from the Azure team. I emailed &lt;a href="http://blog.smarx.com/"&gt;Steve Marx&lt;/a&gt;. He responded quickly and had a plan of action. We had a short email exchange and within a couple hours I was in contact with the right people. The Azure Team to the rescue! Once the team was made aware of my situation, they offered to migrate my data for me. Awesome! While I started out the evening in a bit of a panic, the Azure team restored my confidence. They treated me well and met my needs with excellence. Thanks for being committed to your customers!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53525" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/_h56tXx8t9A" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Azure/default.aspx">Azure</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Cloud+Computing/default.aspx">Cloud Computing</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silver+Arcade/default.aspx">Silver Arcade</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/11/08/a-follow-up-to-my-azure-panic-attack.aspx</feedburner:origLink></item><item><title>Iowa Code Camp November 2009 Slides Up</title><link>http://feedproxy.google.com/~r/Devlicious/~3/p8ZrK-3ZHtI/iowa-code-camp-november-2009-slides-up.aspx</link><pubDate>Sun, 08 Nov 2009 00:39:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53499</guid><dc:creator>Scott Seely</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I want to send out a big thank you to the team who put together the &lt;a target="_blank" href="http://iowacodecamp.com/"&gt;Iowa Code Camp&lt;/a&gt;. You people did an awesome job!!! I had a great time giving my talks and really enjoyed hanging out with the crowd in Iowa.&lt;/p&gt;
&lt;p&gt;For those of you who attended my talks, or just want to see the materials, I&amp;rsquo;ve posted things.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.scottseely.com/downloads/IowaCC.WCF.zip"&gt;WCF Diagnostics Talk and Materials&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.scottseely.com/downloads/IowaCC.WinDBG.zip"&gt;WinDBG Talk and Materials&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See you next year&amp;hellip;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53499" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/p8ZrK-3ZHtI" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/WinDBG/default.aspx">WinDBG</category><feedburner:origLink>http://devlicio.us/blogs/scott_seely/archive/2009/11/07/iowa-code-camp-november-2009-slides-up.aspx</feedburner:origLink></item><item><title>ReSharper Rename Namespace Grayed Out</title><link>http://feedproxy.google.com/~r/Devlicious/~3/65sQJGdC4vo/resharper-rename-namespace-grayed-out.aspx</link><pubDate>Fri, 06 Nov 2009 15:53:55 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53421</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I renamed a folder in my project and opened up the solution. &lt;/p&gt;  &lt;p&gt;When I tried to fix namespacing in the project using Resharper (ClassView, Ctl+Shft+R, Rename), it would not let me.&lt;/p&gt;  &lt;p&gt;I had not rebuilt the solution after having done the rename, so once I did my Rename function was back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53421" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/65sQJGdC4vo" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/ReSharper/default.aspx">ReSharper</category><feedburner:origLink>http://devlicio.us/blogs/mike_nichols/archive/2009/11/06/resharper-rename-namespace-grayed-out.aspx</feedburner:origLink></item><item><title>It takes real balls to do it right</title><link>http://feedproxy.google.com/~r/Devlicious/~3/OFWTCrS2swU/it-takes-real-balls-to-do-it-right.aspx</link><pubDate>Fri, 06 Nov 2009 10:57:19 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53411</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>10</slash:comments><description>&lt;p&gt;It does not take a genius to realize that I (and most others on this blog) are fans of &lt;a href="http://www.jetbrains.com/"&gt;JetBrains&lt;/a&gt;.&amp;#160; But what it may take a genius to realize is it takes balls to do what JetBrains does with their products.&amp;#160; &lt;/p&gt;  &lt;p&gt;You may be asking what exactly I am talking about or referring to?&amp;#160; I am taking about the fact that they are willing to throw caution to the wind and provide very early (and in many cases mostly stable) release of their products to the wild.&amp;#160; What makes this even more crazy/impressive is that they build products for software developers and we all know that software developers are the most vocal and opinionated group of people out there.&lt;/p&gt;  &lt;p&gt;The fact that JetBrains releases software early and often simply makes sense and ALL companies that release software (regardless of the type) and not be afraid of what may happen.&amp;#160; Because putting your product (in this case software) in front of customers early and often will allow you to:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Find and resolve more bugs&lt;/li&gt;    &lt;li&gt;Find and resolve any weak area in usage or workflow&lt;/li&gt;    &lt;li&gt;Find areas of the application that are still lacking&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now the trick to releasing pre-alpha, alpha or even beta software is you MUST listen users feedback and attempt to incorporate or fix any areas of concern (of course only make adjustments if they make sense for the product).&lt;/p&gt;  &lt;p&gt;So, what is the point of this post?&amp;#160; Well 2 things.&amp;#160; 1 to give kudos to JetBrains for again releasing early copies of their software and 2 tell all software companies that releasing early and often will result in a better product.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53411" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/OFWTCrS2swU" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/11/06/it-takes-real-balls-to-do-it-right.aspx</feedburner:origLink></item><item><title>LG BD390 Blu-ray player and D-Link DIR 655 Router: not friends</title><link>http://feedproxy.google.com/~r/Devlicious/~3/lVV46j4mmpc/lg-bd390-blu-ray-player-and-d-link-dir-655-router-not-friends.aspx</link><pubDate>Thu, 05 Nov 2009 00:33:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53383</guid><dc:creator>sergiopereira</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;A month or so ago I bought a Blu-ray player. I waited a bit to buy one of those because,
	frankly speaking, the improved image quality and any bonus features in the discs weren&amp;#39;t
	attractive enough for me to replace the DVD player.&lt;/p&gt;

	&lt;p&gt;I also wanted a networked player that could stream movies from my 
	&lt;a href="http://www.netflix.com"&gt;Netflix&lt;/a&gt; queue. To make matters worse,
	running a CAT-5 cable from my basement (where my wireless router lives) to 
	the bedroom (the BR player&amp;#39;s final destination) wasn&amp;#39;t really something I was 
	looking forward to.&lt;/p&gt;
	
	&lt;p&gt;
	&lt;a href="http://www.amazon.com/dp/B001UQ6F5M?tag=by-asin-tag-20"&gt;&lt;img src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/sergio_5F00_pereira.2009.11/brplayer.png" align="right" border="0" alt="" /&gt;&lt;/a&gt;
	That&amp;#39;s when I did some shopping around and came across the 
	&lt;a href="http://www.amazon.com/dp/B001UQ6F5M?tag=by-asin-tag-20"&gt;LG BD390&lt;/a&gt; 
	Wi-Fi-enabled Blu-ray player. It supports wireless 802.11n and access to a few online
	services like YouTube, Netflix and &lt;a href="http://www.vudu.com/"&gt;VUDU&lt;/a&gt;. It can
	also find media in my home network.&lt;/p&gt;

	&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; I know there&amp;#39;s always someone that will come suggest taking a look at the
	PS3 or XBOX can do some or all of that. I&amp;#39;m not a gamer so I didn&amp;#39;t want to
	have a gaming console in my bedroom and deal with issues related to 
	the &lt;i&gt;not being a simple player&lt;/i&gt; aspects of the device (like maybe having
	to buy extra adapters/connectors, remote control, and what-have-you). It&amp;#39;s
	probably a no-brainer if you&amp;#39;re into video games. Did I say I do not buy Sony?&lt;/p&gt;

	&lt;h3&gt;Welcome LG BD390&lt;/h3&gt;

	&lt;p&gt;So I went and bought the LG BD390 and installed it where it was supposed to be. I
	was a little worried about not having the 802.11n router setup yet (it was still
	on its way) but I decided to give it a shot even on my 5-year old 802.11g router. 
	I thought maybe I wouldn&amp;#39;t get HD streaming or choppy video, but at least I would
	get a feeling about the device&amp;#39;s capabilities while I waited for the new router to 
	arrive.&lt;/p&gt;

	&lt;h3&gt;Works great on wireless-G&lt;/h3&gt;

	&lt;p&gt;To my surprise, the LG BD390 worked great over wireless-G. Setup is incredibly easy
	(the only hard part was really entering the long WPA password using the on-screen
	keyboard.) It boots up fast. Within 5 minutes from its first power-on it had
	already found and updated its firmware, I had activated my Netflix streaming
	and The Office was streaming in HD on my TV.&lt;/p&gt;

	&lt;p&gt;Best gadget purchase in years. This device will definitely change the way I watch movies and 
	TV series, and listen to music (BTW, since it&amp;#39;s easy to upgrade the firmware and
	other LG products offer Pandora, here&amp;#39;s to hoping the BD390 gets that too soon.)&lt;/p&gt;

	&lt;h3&gt;But not so fast. Bad wireless-N surprise.&lt;/h3&gt;

	&lt;p&gt;You&amp;#39;d think that by upgrading my network to wireless-N would only make the
	whole experience much better, right? Me too.&lt;/p&gt;

	&lt;p&gt;
	&lt;a href="http://www.amazon.com/dp/B000LIFB7S?tag=by-asin-tag-20"&gt;&lt;img src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/sergio_5F00_pereira.2009.11/router.png" align="left" border="0" style="margin-right:10px;" alt="" /&gt;&lt;/a&gt;
	I upgraded my trusty wireless-G router with a shiny new D-Link
	&lt;a href="http://www.amazon.com/dp/B000LIFB7S?tag=by-asin-tag-20"&gt;DIR 655&lt;/a&gt; 
	wireless-N Gigabit model. It has some interesting features, USB port, decent 
	firmware features (well, read on,) and seems rather popular anyway.&lt;/p&gt;

	&lt;p&gt;Once I configured it to the exact same network settings as the previous router, I
	checked the laptops were working fine with it and went straight to enjoy some more
	streaming on my Blur-ray player. I immediately noticed that the signal strength had
	dropped from 5 bars to 2, 1, and sometimes no bars at all. Even when a couple of bars 
	were there, it wouldn&amp;#39;t even browse my local network.&lt;/p&gt;

	&lt;p&gt;I even tried using a &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16833166042"&gt;cheap-o router&lt;/a&gt; 
	in repeater mode but it didn&amp;#39;t play well with my D-Link router and even the laptops
	would lose connectivity at random when this thing was active &amp;mdash; I ended up
	returning it.
	&lt;/p&gt;

	&lt;p&gt;A month later (and a few lost frustrating hours) later I came across 
	&lt;a href="http://www.amazon.com/review/R4XT8B6JVOZ58/ref=cm_srch_res_rtr_alt_1"&gt;this post&lt;/a&gt;
	on the Amazon reviews for the player. Basically, even though there was a new firmware available,
	the router insisted in telling me it had the latest one. And it just so happens that the
	firmware it had (v1.2) had some serious bugs. Short version, many times it would not work
	at all with the Blu-ray player.&lt;/p&gt;

	&lt;p&gt;I followed the suggested instructions and things are much better now. I still get a very
	weak signal but at least I&amp;#39;m able to consistently stream HD content. I hope the
	next version of the BD390 comes with an external antenna. I might try another
	router and see if they have a stronger signal &amp;mdash; this seems to be a common
	complaint about this D-Link model.&lt;/p&gt;

	&lt;p&gt;So if you&amp;#39;re in the market for a Blu-ray player I can recommend LG&amp;#39;s BD390
	but I&amp;#39;d suggest you search the web for any issues with your wireless-N router
	(unless you&amp;#39;re planning to wire it up, in that case I recommended it 100%).
	If you&amp;#39;re buying your router together with the BR player, buy it from a store
	that you can easily return it in case it doesn&amp;#39;t work well with the BR player.
	On the other hand, if you&amp;#39;re looking for a new router, I cannot recommend 
	D-Link&amp;#39;s DIR 655.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53383" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/lVV46j4mmpc" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/review/default.aspx">review</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/gadgets/default.aspx">gadgets</category><feedburner:origLink>http://devlicio.us/blogs/sergio_pereira/archive/2009/11/04/lg-bd390-blu-ray-player-and-d-link-dir-655-router-not-friends.aspx</feedburner:origLink></item><item><title>Speaking at Virtual ALT.NET Tonight</title><link>http://feedproxy.google.com/~r/Devlicious/~3/olWn5mcSS3I/speaking-at-virtual-alt-net-tonight.aspx</link><pubDate>Wed, 04 Nov 2009 17:07:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53377</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;If you&amp;#39;re interested in...&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finding out what&amp;#39;s new in &lt;a href="http://wiki.sharparchitecture.net/"&gt;S#arp Architecture&lt;/a&gt; Q3 2009,&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Hearing about what the &lt;a href="http://wiki.sharparchitecture.net/SharpArchContrib.ashx"&gt;Contrib&lt;/a&gt; project has to offer,&lt;/li&gt;
&lt;li&gt;Going into a couple of S#arp topics in detail, such as...
&lt;ul&gt;
&lt;li&gt;Getting up and running quickly,&lt;/li&gt;
&lt;li&gt;Handling object associations,&lt;/li&gt;
&lt;li&gt;Using an &lt;a href="http://martinfowler.com/eaaCatalog/serviceLayer.html"&gt;Application Services&lt;/a&gt; layer and&lt;/li&gt;
&lt;li&gt;Practical implementation of &lt;a href="http://devlicio.us/blogs/casey/archive/2009/02/12/ddd-command-query-separation-as-an-architectural-concept.aspx"&gt;Command/Query Separation&lt;/a&gt; (or &amp;quot;Domain/Reporting Separation&amp;quot; from my perspective).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then join us tonight at &lt;a href="http://virualaltnet.blogspot.com/2009/11/billy-mccafferty-talking-about-sarp.html"&gt;Virtual ALT.NET&lt;/a&gt;, 9 - 11 PM Eastern time.&lt;/p&gt;
&lt;p&gt;Billy McCafferty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53377" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/olWn5mcSS3I" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/S_2300_arp+Architecture/default.aspx">S#arp Architecture</category><feedburner:origLink>http://devlicio.us/blogs/billy_mccafferty/archive/2009/11/04/speaking-at-virtual-alt-net-tonight.aspx</feedburner:origLink></item><item><title>Microsoft, what is the meaning of this?</title><link>http://feedproxy.google.com/~r/Devlicious/~3/khAYbur7DNQ/microsoft-what-is-the-meaning-of-this.aspx</link><pubDate>Tue, 03 Nov 2009 00:01:21 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53336</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;I just received this email on November 2nd at 6pm.&amp;#160; I hadn’t heard a word of this prior.&amp;#160; Thanks for the warning…&lt;/p&gt;  &lt;p&gt;Windows Azure CTP participant,&lt;/p&gt;  &lt;p&gt;You are receiving this mail because you have an application or storage account in Windows Azure in the “USA - Northwest” region.&amp;#160; Windows Azure production applications and storage will no longer be supported in the ‘USA-Northwest’ region.&amp;#160; We will be deleting all Windows Azure applications and storage accounts in the “USA - Northwest” region on November 3rd.&lt;/p&gt;  &lt;p&gt;To move your application/storage, first delete the project using the “Delete Service” button.&amp;#160; Then recreate it, choosing the “USA - Southwest” region.&amp;#160; (It may take a few minutes for your previous application and storage account names to become available again.)&lt;/p&gt;  &lt;p&gt;&lt;img src="http://sn129w.snt129.mail.live.com/mail/SafeRedirect.aspx?hm__tg=http://65.55.72.103/att/GetAttachment.aspx&amp;amp;hm__qs=file%3da56c5363-e523-49ca-bfd9-d91751b0904d.png%26ct%3daW1hZ2UvcG5n%26name%3daW1hZ2UwMDEucG5n%26inline%3d1%26rfc%3d0%26empty%3dFalse%26imgsrc%3dcid%253aimage001.png%254001CA5BCE.CB2AA280&amp;amp;oneredir=1&amp;amp;ip=10.13.130.8&amp;amp;d=d3873&amp;amp;mf=0&amp;amp;a=01_8025b7aca3a51f26de9526725af9bcd106dcd43fa8ef566cf0d28def93d856fc" width="400" height="176" alt="" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Note that deleting your storage account will destroy all of the data stored in that account.&lt;/b&gt;&amp;#160; Copy any data you wish to preserve first.&lt;/p&gt;  &lt;p&gt;If you would like help migrating your project or have any other concerns, please reply to this mail.&lt;/p&gt;  &lt;p&gt;- The Windows Azure Team&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53336" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/khAYbur7DNQ" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/11/02/microsoft-what-is-the-meaning-of-this.aspx</feedburner:origLink></item><item><title>When NHibernate Won't Do What You Think It Should</title><link>http://feedproxy.google.com/~r/Devlicious/~3/PTfnKR6Feh0/when-nhibernate-won-t-do-what-you-think-it-should.aspx</link><pubDate>Mon, 02 Nov 2009 13:57:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53319</guid><dc:creator>Jak Charlton</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;There are times, when you just think something should work, and one way or another it just doesn&amp;#39;t. I&amp;#39;ve been having one of those weeks with NHibernate. I have been&amp;nbsp;using MS SQL Server 2008 spatial searching, along with SQL Server Full text search, and using NHibernate for almost all my data access.&lt;/p&gt;
&lt;p&gt;The only problem is that NHibernate out of the box doesn&amp;#39;t like to play nicely with Spatial or Fulltext. After head scratching, head bashing, and general teeth grinding I figured better to cut my losses and ask some people that actually knew what they were doing.&lt;/p&gt;
&lt;p&gt;Firstly I fired a twitter off in the direction of Ayende to get a feel for whether I was doing something wrong - with CreateSqlQuery NHibernate didn&amp;#39;t want me to use the Spatial stuff - NHibernate uses a colon : to identify parameters, but in SQL 2008 Microsoft decided to use a double colon :: in it&amp;#39;s spatial bits, so for example to declare a point you would use:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;geography::STGeomFromText(&amp;#39;POINT(51.520223 -0.094693 )&amp;#39;, 4326)&lt;/p&gt;
&lt;p&gt;That promptly causes NH to stop you from carrying on with a missing parameter. Ayende did indeed confirm it&amp;#39;s not right, and after a few helpful suggestions he ran out of quick wins and suggested I might want to take advantage of his &lt;a href="http://nhprof.com/commercialsupport"&gt;commercial support for NHibernate&lt;/a&gt;. I&amp;#39;m not adverse to such a solution, but felt this one might get complex, and Ayende&amp;#39;s payment structure didn&amp;#39;t fit my needs - this is a small project for a small client, and I could work around NH&amp;#39;s limitations by using stored procedures (yes, I know, heresy).&lt;/p&gt;
&lt;p&gt;After a bit more head scratching I remebered that &lt;a href="http://www.imeta.co.uk/"&gt;iMeta&lt;/a&gt; also &lt;a href="http://www.imeta.co.uk/professional_nhibernate_support.aspx"&gt;provide NH commecial support&lt;/a&gt; now, and having taken&amp;nbsp;a look at their pages, I figured it would work much better for my limited budget.&lt;/p&gt;
&lt;p&gt;After a&amp;nbsp; quick chat with &lt;a href="http://hadihariri.com/blogengine/"&gt;Hadi Hariri&lt;/a&gt;, he directed me on to &lt;a href="http://blogs.imeta.co.uk/sstrong/Default.aspx"&gt;Steve Strong&lt;/a&gt;, the man who wrote a great deal of the Linq to NHibernate stuff, and a bit of an expert on the parser.&lt;/p&gt;
&lt;p&gt;Steve ripped through my queries with lighning pace, and had me a viable solution that afternoon - now that&amp;#39;s what I call customer service. Today Steve has continued to sort out niggles with the problem, and it looks like we may have identified a few bugs in NHibernate Spatial and possibly the parser, which Steve will now push back into the NH trunk for future geenrations to benefit from.&lt;/p&gt;
&lt;p&gt;So, althought NHibernate is open source software, and in theory you can fix this stuff yourself, this is just a post to point out that sometimes the best use of your time and effort is in things you can deal with quickly, and sometimes it is worth paying some real specialists to help out - the cost saving could be immense. If you have problems with NHibernate, I encourage you to take a look at the offerings available, &lt;a href="http://www.imeta.co.uk/professional_nhibernate_support.aspx"&gt;especially the iMeta one&lt;/a&gt; :)&lt;/p&gt;
&lt;p&gt;Just because NHibernate is free - doesn&amp;#39;t mean it isn&amp;#39;t worth paying for!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53319" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/PTfnKR6Feh0" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/casey/archive/tags/NHibernate/default.aspx">NHibernate</category><feedburner:origLink>http://devlicio.us/blogs/casey/archive/2009/11/02/when-nhibernate-won-t-do-what-you-think-it-should.aspx</feedburner:origLink></item><item><title>Speaking at nPlus1 ArcSummit- Chicago</title><link>http://feedproxy.google.com/~r/Devlicious/~3/MFsHtihm78U/speaking-at-nplus1-arcsummit-chicago.aspx</link><pubDate>Mon, 02 Nov 2009 13:18:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53317</guid><dc:creator>Scott Seely</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;On December 7, I&amp;rsquo;ll be speaking at the nPlus1 ArcSummit for the optional morning session. I&amp;rsquo;d love to see the place packed! Here are the details:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.clicktoattend.com/invitation.aspx?code=142763"&gt;https://www.clicktoattend.com/invitation.aspx?code=142763&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;About nPlus1.org&lt;/h3&gt;
&lt;p&gt;nPlus1.org is a site dedicated to helping Architects, aspiring Architects and Lead Developers learn, connect and contribute. On this site you&amp;rsquo;ll have access to great first party content written by some of the most skilled and experienced Architects working today. You&amp;rsquo;ll also have access to, and be able to contribute to a nexus of content from around the Internet aimed at keeping Architects up to date on all the new developments in their fields of interest.&lt;/p&gt;
&lt;h4&gt;When&lt;/h4&gt;
&lt;p&gt;Monday December 7, 2009 &amp;ndash; 10:00PM to 5:00PM&lt;/p&gt;
&lt;h4&gt;Where&lt;/h4&gt;
&lt;p&gt;Microsoft MTC - Aon Center&lt;/p&gt;
&lt;p&gt;200 E. Randolph&lt;/p&gt;
&lt;p&gt;Suite 200&lt;/p&gt;
&lt;p&gt;Chicago, IL 60601&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.clicktoattend.com/directions.aspx?code=142763"&gt;driving directions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Free Lunch Provided&lt;/b&gt;&lt;/p&gt;
&lt;h4&gt;Agenda&lt;/h4&gt;
&lt;h5&gt;Morning Session (Optional): An Introduction to Object Oriented Programming &lt;/h5&gt;
&lt;p&gt;10:00 AM - 12:00 PM&lt;/p&gt;
&lt;p&gt;Are you new to OOP? Do you want a refresher on the benefits of Interfaces and the differences between implements and extends? The morning session is a two hour introductory course of Object Oriented Programming. If you are new to OOP the lessons in this session will prepare you for the more advanced topics in the afternoon.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;If you are already well versed in OOP then feel free to come have a refresher, or simply join us for lunch and the advanced sessions in the afternoon. The morning session is completely optional.&lt;/i&gt;&lt;/p&gt;
&lt;h5&gt;Afternoon sessions:&lt;/h5&gt;
&lt;h5&gt;Session One: Software Patterns&lt;/h5&gt;
&lt;p&gt;Patterns are an important tool to use as architects and developers. They provide a common vocabulary for us to design with, as well as a common approach to a common problem. Come learn about useful patterns, and how to use them in your everyday code.&lt;/p&gt;
&lt;h5&gt;Session Two: How I Learned To Love Dependency Injection &lt;/h5&gt;
&lt;p&gt;Dependency Injection is one of those scary topics that most developers avoid. It sounds all &amp;lsquo;high-falootin&amp;rsquo; and complex. It&amp;rsquo;s not. Really. We wouldn&amp;rsquo;t lie. It&amp;rsquo;s a great way to manage complexity in your system, and a great way to make your system so much more testable. And isn&amp;rsquo;t that what we all want? &lt;/p&gt;
&lt;p&gt;Each session will be followed by open discussions periods.&lt;/p&gt;
&lt;p&gt;A catered lunch will be provided starting at noon. This will divide the morning introductory sessions from the advanced sessions. Register once for all session and choose to attend the morning, the afternoon or both! Lunch is provided for attendees for any of the sessions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53317" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/MFsHtihm78U" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/scott_seely/archive/2009/11/02/speaking-at-nplus1-arcsummit-chicago.aspx</feedburner:origLink></item><item><title>Development Methodology "Renovation"</title><link>http://feedproxy.google.com/~r/Devlicious/~3/_r_50KRehK0/development-methodology-quot-renovation-quot.aspx</link><pubDate>Sun, 01 Nov 2009 00:18:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53281</guid><dc:creator>Jeff Perrin</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I was watching &lt;a href="http://en.wikipedia.org/wiki/Holmes_on_Homes"&gt;Holmes on Homes&lt;/a&gt; today and got to thinking about parallels (or lack of them) between renovating and building a home vs developing a software application. Some of what I was thinking ties in with the &amp;quot;&lt;a href="http://www.infoq.com/presentations/craftmanship-ethics"&gt;software development as craftsmanship&lt;/a&gt;&amp;quot; discussion that pops up every now and then, but mainly this is just a brain dump.
First off, let&amp;#39;s set this up. What I&amp;#39;m thinking is that a &amp;quot;software application&amp;quot; maps directly to a &amp;quot;home renovation project&amp;quot; or just actually building a new home. Here are some of the obvious parallels:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In a home building project you have a general contractor who oversees the entire operation, hiring other contractors or bringing in employees as needed. Software projects will generally have some sort of equivalent &amp;quot;lead/architect&amp;quot; role.&lt;/li&gt;
&lt;li&gt;Both projects would have clients that most likely have no idea what&amp;#39;s going on. They see the end result and have no way of knowing whether that result will last 2 months or 20 years. Generally, as long as the finished product looks pretty and seems to do what&amp;#39;s required the developers/renovators will get paid.&lt;/li&gt;
&lt;li&gt;Size matters in both professions. Anybody can hack their way through installing new countertops or building a simple CRUD web app, but the bigger and more complex the problem gets, the more professionalism and care is required. I&amp;#39;ll take a calculated leap and say that many of the problem projects in both professions happen because somebody who can &amp;quot;install a new faucet&amp;quot; gets it in their heads that they can also &amp;quot;renovate the entire basement&amp;quot; using the same amount of knowledge and preparation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I&amp;#39;m sure there&amp;#39;s a few more parallels, but you get the idea. Now let&amp;#39;s focus on some differences...
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A general contractor doing a home renovation will bring in &amp;quot;specialists&amp;quot; to work on individual pieces of the project, whereas many software projects are made up of &amp;quot;generalists&amp;quot;. As programmers, we are often tasked with developing business logic, writing html, security, usability, system administration, deployment, testing, etc. Just look at the range of what&amp;#39;s required in the average job posting for a software developer. This is obviously not true in all cases, but in general this is what I think is happening out there.&lt;/li&gt;
&lt;li&gt;The home building industry has these crazy things called &amp;quot;inspections&amp;quot; that are supposed to ensure the builders don&amp;#39;t pull some crazy shit that could endanger the client. Imagine code inspections (by an honest inspector we hope) and how they could protect a client... An inspector could obviously not be expected to know if the application is running a calculation correctly, but that is the &lt;em&gt;one &lt;/em&gt;thing that a client &lt;em&gt;can &lt;/em&gt;confirm. An inspector could, however, check for &lt;em&gt;signs of incompetence&lt;/em&gt; such as SQL injection vulnerabilities, obvious spaghetti code, code duplication, lack of tests, poorly designed databases, mangled HTML, obvious usability disasters and so on. Once notified of the issues, the client would be able to take action as they see fit.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
My thinking is that, at least in my own experience, the best project I&amp;#39;ve worked on (in terms of happiness of the client and its likelihood of being maintainable for years to come) was the project that was most similar to a successful home reno project. We had a UI specialist, a bunch of developers focused mainly on the business logic, and testers. Other &amp;quot;specialists&amp;quot; were brought in as needed for database tuning and system admin type work. An &amp;quot;inspector&amp;quot; even came to the project at one stage. This inspector was &lt;a href="http://blog.sym-link.com/"&gt;Eric Evans&lt;/a&gt;, who showed up and observed the project for a week and delivered a report on what was good and what could be improved. This visit seemed to be largely positive (I showed up a few months after he came so I can&amp;#39;t know for sure) in the sense that it gave the development team some reassurance and some focus on what could be improved. I&amp;#39;m not sure what the clients got out of it.
I&amp;#39;m wondering if a working on a new project with the goal of running it consciously more like a home reno project could improve things. For example:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Think of hiring for &amp;quot;concerns&amp;quot; instead of technologies (ie; security &amp;amp; usability instead of Java &amp;amp; Struts).&lt;/li&gt;
&lt;li&gt;Have a defined &amp;quot;general contractor&amp;quot; role that is in place to hire and fit all the pieces together.&lt;/li&gt;
&lt;li&gt;Allow the specialists to come and go. There&amp;#39;s no need to keep everyone around all the time. Call them in when there is a need.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Based on my own limited experience I think doing software development as a home renovation could really work, especially when it comes to focusing on roles and quality. Should &lt;em&gt;any &lt;/em&gt;project be open to an SQL injection attack ever? Hell no, there&amp;#39;s just no excuse for that kind of incompetence. But so many are... Inspections and specialists might be one way to mitigate this.
In closing, I&amp;#39;d like to hear other people&amp;#39;s thoughts on this. If it&amp;#39;s already been said before (better hopefully), I&amp;#39;d like to read more about it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53281" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/_r_50KRehK0" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/jeff_perrin/archive/tags/craftsmanship/default.aspx">craftsmanship</category><feedburner:origLink>http://devlicio.us/blogs/jeff_perrin/archive/2009/10/31/development-methodology-quot-renovation-quot.aspx</feedburner:origLink></item><item><title>NHProf and Caliburn Testability</title><link>http://feedproxy.google.com/~r/Devlicious/~3/basRaEUJU1M/nhprof-and-caliburn-testability.aspx</link><pubDate>Fri, 30 Oct 2009 19:07:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53240</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I&amp;rsquo;ve heard some developers asking about UI testing lately.&amp;nbsp; Specifically, there have been some questions about what we did with NHProf.&amp;nbsp; So, I thought I would write a little bit about that here.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;There are a variety of different types of tests you can do.&amp;nbsp; In my experience some have a better ROI than others.&amp;nbsp; For example, we don&amp;rsquo;t do any UI testing with automation APIs.&amp;nbsp; Those are pretty painful, brittle tests to write and we haven&amp;rsquo;t worked in scenarios where they would really help us.&amp;nbsp; The two main types of UI testing we tend to do are Unit Tests of the View Model and Binding Validation Tests against the Views.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;View Model Tests&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are many advantages in taking a View Model approach to building your UI.&amp;nbsp; When we build VMs we try and push as much of the UI state into our models as possible.&amp;nbsp; By doing this we &amp;ldquo;virtualize&amp;rdquo; our entire UI, allowing us to simulate a large percentage of the UI behavior without ever opening a Window or showing anything on screen.&amp;nbsp; This is great for testability.&amp;nbsp; It means, we can use simple state based unit tests to verify the behavior of our UI.&amp;nbsp; Here&amp;rsquo;s a simple example from NHProf:&lt;/p&gt;
&lt;pre name="code" class="c#"&gt;public class StatementFilterTestFixture
{
    private readonly FilterServiceModel service;
    private readonly IList&amp;lt;IStatementSnapshot&amp;gt; statements;

    public StatementFilterTestFixture()
    {
        statements = new List&amp;lt;IStatementSnapshot&amp;gt;
                         {
                             create_a_statement(100, &amp;quot;hello&amp;quot;),
                             create_a_statement(200, &amp;quot;select * from something&amp;quot;),
                             create_a_statement(300, &amp;quot;select field1 from something&amp;quot;),
                             create_a_statement(400, &amp;quot;select monkey,ninja,pirate,robot from floating_island&amp;quot;),
                             create_a_statement(500, &amp;quot;&amp;quot;),
                         };

        service = new FilterServiceModel();
    }

    [Fact]
    public void Can_filter_by_both_duration_for_values_less_than_300_and_contains_text()
    {
        var filters = new ObservableCollection&amp;lt;IFilter&amp;gt;
                          {
                              new FilterByDuration
                              {
                                  Operator = ExpressionType.LessThan, 
                                Value = &amp;quot;300&amp;quot;
                              },
                              new FilterBySqlContains {Text = &amp;quot;something&amp;quot;}
                          };

        service.Filters = filters;

        Assert.Equal(1, statements.Where(x =&amp;gt; service.FilterStatement(x)).Count());
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Binding Validation Tests&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;While the WPF/SL data binding mechanism opens the door to building rich View Models, it also introduces a new problem: potential binding expression errors.&amp;nbsp; Because we didn&amp;rsquo;t want to give up the productivity benefits of databinding and View Models, we chose to take some time to build a binding validation framework.&amp;nbsp; We then write simple tests to insure that there are no typos or silly mistakes in our binding expressions.&amp;nbsp; Here&amp;rsquo;s an example test from NHProf:&lt;/p&gt;
&lt;pre name="code" class="c#"&gt;public class StatisticsDetailsTestFixture : ViewTestFixtureBase
{
    private readonly ValidationResult&amp;lt;StatisticsModel&amp;gt; bindings;

    public StatisticsDetailsTestFixture()
    {
        bindings = Validator.For&amp;lt;StatisticDetailsView, StatisticsModel&amp;gt;()
            .Validate();
    }

    [Fact]
    public void BindingsDoNotHaveErrors()
    {
        Assert.False(bindings.HasErrors, bindings.ErrorSummary);
    }

    [Fact]
    public void NameIsBound()
    {
        Assert.True(bindings.WasBoundTo(x =&amp;gt; x.DisplayName));
    }

    [Fact]
    public void StatisticsAreBound()
    {
        Assert.True(bindings.WasBoundTo(x =&amp;gt; x.SortedStatistics));
    }
}&lt;/pre&gt;
&lt;p&gt;You can actually take this one step farther as &lt;a href="http://nhforge.org/blogs/nhibernate/archive/2009/08/19/nhibernate-and-wpf-viewmodels-and-views.aspx"&gt;Jos&amp;eacute; Romaniello&lt;/a&gt; has in testing his Chinook Media Manager.&amp;nbsp; Take a look at &lt;a href="http://code.google.com/p/unhaddins/source/browse/trunk/Examples/uNHAddIns.Examples.WPF/ChinookMediaManager.View.Test/TestDataBindings.cs"&gt;this sweet piece of code&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53240" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/basRaEUJU1M" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/NHProf/default.aspx">NHProf</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/10/30/nhprof-and-caliburn-testability.aspx</feedburner:origLink></item><item><title>Castle Dynamic Proxy tutorial part XV: Patterns and Antipatterns</title><link>http://feedproxy.google.com/~r/Devlicious/~3/twrNsBG0TtU/castle-dynamic-proxy-tutorial-part-xv-patterns-and-antipatterns.aspx</link><pubDate>Fri, 30 Oct 2009 10:32:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53226</guid><dc:creator>Krzysztof Koźmic</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;We’ve &lt;a href="http://kozmic.pl/archive/2009/04/27/castle-dynamic-proxy-tutorial.aspx" target="_blank"&gt;covered almost all of Dynamic Proxy&lt;/a&gt;. If you followed along through this series, you now know 95% of Dynamic Proxy 2.1 features that get used 99,9% of the time. Now is the time to wrap up, and with that we’ll review some of the most common pitfalls that you may encounter when developing code on top of Dynamic Proxy.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Leaking this&lt;/h3&gt;  &lt;p&gt;Consider this simple interface/class pair&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;public interface IFoo
{
    IFoo Bar();
}
 
public class Foo : IFoo
{
    public IFoo Bar()
    {
        return this;
    }
}&lt;/pre&gt;

&lt;p&gt;Now, let’s say we create a proxy for IFoo with target and use it like this:&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;var foo = GetFoo(); // returns proxy
var bar = foo.Bar();
bar.Bar();&lt;/pre&gt;

&lt;p&gt;Can you see the bug here? The second call is performed not on a proxy but on a target object itself! Our proxy is leaking its target.&lt;/p&gt;

&lt;p&gt;This issue obviously does not affect class proxies (since in that case proxy and target are the same object). Why does not Dynamic Proxy handle this scenario on its own? Because there’s no general easy way to handle this. The example I showed is the most trivial one, but proxied object can leak this in a myriad of different ways. It can leak it as a property of returned object, it can leak it as &lt;i&gt;sender&lt;/i&gt; argument of raised event, it can assign &lt;i&gt;this&lt;/i&gt; to some global variable, it can pass itself to a method on one of its own arguments etc. Dynamic Proxy can’t predict any of these, nor should it.&lt;/p&gt;

&lt;p&gt;In some of these cases there is often not much you can do about it, and its good to know that problem like this exist, and understand its consequences. In other cases though, fixing the issue is very simple indeed.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public class LeakingThisInterceptor:IInterceptor
{
    public void Intercept(IInvocation invocation)
    {
        invocation.Proceed();
        if(invocation.ReturnValue == invocation.InvocationTarget)
        {
            invocation.ReturnValue = invocation.Proxy;
        }
    }
}&lt;/pre&gt;

&lt;p&gt;You add an interceptor (put it as last one in the interceptors pipeline), that switches the leaking target back to proxy instance. It’s as simple as that. Notice that this interceptor is targeted specifically at the scenario from our example above (target leaking via return value). For each case you will need a dedicated interceptor.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Override equality&lt;/h3&gt;

&lt;p&gt;One of the most common mistakes when it comes to Dynamic Proxy is not overriding Equals/GetHashCode methods on proxy generation hooks and interceptor selectors, which means you’re giving up &lt;a href="http://kozmic.pl/archive/0001/01/01/castle-dynamic-proxy-tutorial-part-xii-caching.aspx" target="_blank"&gt;caching&lt;/a&gt; and that in turn coupled with &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=472622&amp;amp;wa=wsignin1.0" target="_blank"&gt;bugs in BCL&lt;/a&gt; means performance hit (plus increased memory consumption).&lt;/p&gt;

&lt;p&gt;Solution is very simple, and there’s no exceptions to this rule – always override Equals/GetHashCode methods on all your classes implementing either IProxyGenerationHook or IInterceptorSelector.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Make your Proxy Generation Hooks purely functional&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Functional_programming#Pure_functions" target="_blank"&gt;Pure function&lt;/a&gt;, is a function that for given set of inputs always returns the same output. In case of proxy generation hook, it means that two equal (as specified by overriden Equals/GetHashCode methods) proxy generation hooks will for given type to proxy return the same values from their methods, and when asked again about the same type will again return the same values/throw the same exceptions.&lt;/p&gt;

&lt;p&gt;This is a major assumption that Dynamic Proxy makes, and that’s what makes the caching mechanism work. If proxy generation hook is equal to the one already used to generate a proxy type, Dynamic Proxy will assume it would return the same values as the other one, which would result in identical proxy type, so it cuts through the generation process and returns the existing proxy type.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Make your supporting classes serializable&lt;/h3&gt;

&lt;p&gt;If you’re going to be serializing your proxies, you should make all the classes that go with it serializable. That includes proxy generation hooks, interceptors and interceptor selectors. Otherwise you will get an exception when trying to serialize your proxies. It is not mandatory, but I find it useful. Notice that you will need this also when persisting your proxy assembly to disk.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Use ProxyGenerationHooks and InterceptorSelectors for fine grained control&lt;/h3&gt;

&lt;p&gt;Do your interceptor’s methods look like this?&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public void Intercept(IInvocation invocation)
{
    if(invocation.TargetType!=typeof(Foo))
    {
        invocation.Proceed();
        return;
    }
    if(invocation.Method.Name!=&amp;quot;Bar&amp;quot;)
    {
        invocation.Proceed();
        return;
    }
    if(invocation.Method.GetParameters().Length!=3)
    {
        invocation.Proceed();
        return;
    }
    DoSomeActualWork(invocation);
}&lt;/pre&gt;

&lt;p&gt;If they do this often means you’re doing something wrong. Move the decisions to proxy generation hook and interceptor selector&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Do I ever want to intercept this method? If the answer is no, use proxy generation hook to filter it out of methods to proxy. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Notice that due to bug in Dynamic Proxy 2.1, if you choose not to proxy method on interface proxy, you will get an exception. Workaround for this is to say you want to intercept the method, and then use interceptor selector to return no interceptors for the method. This bug is fixed in Dynamic Proxy 2.2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;If I do want to intercept this method, which interceptors do I want to use? Do I need all of them? Do I need just a single one? Use interceptor selector to control this. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the other hand, remember that as every feature this one is also a double edged sword. Too liberal use of proxy generation hooks and interceptor selectors may greatly decrease efficiency of proxy type caching, which may hurt your performance. As always think how much control you need and what the implications on caching will be. Sometimes single if on top of your interceptor is lesser evil than increasing number of proxies required tenfold. As always – use the profiler in scenarios that mimic your production scenarios as closely as possible to check which option is the best for you.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;SRP applies to interceptors&lt;/h3&gt;

&lt;p&gt;SRP stands for &lt;a href="http://en.wikipedia.org/wiki/Single_responsibility_principle" target="_blank"&gt;Single Responsibility Principle&lt;/a&gt;, which means that a class should do just one thing. Many people seem to forget about it when it comes to interceptors. They create one monstrous interceptor class that tries to do all the things they need from Dynamic Proxy – logging, security checking, parameter verification, augmenting target objects with behavior and many more.&lt;/p&gt;

&lt;p&gt;Remember that Dynamic Proxy lets you have many interceptors per method call. Use this ability to split behavior between interceptors. You may end up with some general purpose interceptors for things like logging that you use for each intercepted method on each class. As long as all it does is logging – that’s ok.&lt;/p&gt;

&lt;p&gt;You may end up with some interceptors that are used for methods on just some classes, like classes inheriting from common base class. As long as these interceptors do just one thing – that’s fine.&lt;/p&gt;

&lt;p&gt;You may end up with some interceptors that exist solely for the purpose of intercepting just a single method on specific class or interface. That also is fine. Use interceptor selectors to match interceptors to their respective targets, and don’t be afraid to have multiple interceptors per method.&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:49834463-257e-4f2b-9ecc-f80d1e82e23e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Dynamic+Proxy" rel="tag"&gt;Dynamic Proxy&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Castle" rel="tag"&gt;Castle&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53226" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/twrNsBG0TtU" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/krzysztof_kozmic/archive/tags/Castle/default.aspx">Castle</category><feedburner:origLink>http://devlicio.us/blogs/krzysztof_kozmic/archive/2009/10/30/castle-dynamic-proxy-tutorial-part-xv-patterns-and-antipatterns.aspx</feedburner:origLink></item><item><title>The HornGet Project: Bringing "apt-get install" to .NET Projects</title><link>http://feedproxy.google.com/~r/Devlicious/~3/OX8m48VhD_8/the-horn-project-bringing-quot-apt-get-install-quot-to-net-projects.aspx</link><pubDate>Fri, 30 Oct 2009 02:34:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53217</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>15</slash:comments><description>&lt;p&gt;For years I used nothing but Windows. &amp;nbsp;When I started getting into robotics (for fun - let me know if you&amp;#39;d like me to do it professionally ;), I had to dive into the Linux world. &amp;nbsp;After only a couple of weeks with Ubuntu, I was stunned at how far behind our Microsoft-following community is in some respects. &amp;nbsp;Take Linux&amp;#39;s &amp;quot;apt-get install&amp;quot; command, for example. &amp;nbsp;Running this simple command, followed by an application name, finds the referenced application on the &amp;quot;Information Super Highway,&amp;quot; downloads the binaries and installs it locally. &amp;nbsp;No biggie, right? &amp;nbsp;Well it also looks to see what dependencies the application has, downloads the latest of all of them, and installs them as well before installing the target application. &amp;nbsp;It does all of that with just one command line (and sometimes even successfully! ;).&lt;/p&gt;
&lt;p&gt;There are two scenarios that come to mind where something like &amp;quot;apt-get install&amp;quot; is tremendously useful when developing a project. &amp;nbsp;The first, and most akin to the intent of &amp;quot;apt-get install&amp;quot; is when you&amp;#39;re managing an open source project (e.g., &lt;a href="http://wiki.sharparchitecture.net/"&gt;S#arp Architecture&lt;/a&gt;) and want to provide an easy way for developers to get the latest of the project while concurrently grabbing the latest of its dependencies (e.g., Rhino tools, NHibernate, Fluent NHibernate, MVCConrib) in the process. &amp;nbsp;The second scenario is if you have a project which has a large number of dependencies and dread checking for updates to the project dependencies. &amp;nbsp;Which dependencies do you download? &amp;nbsp;Where do you find the source? &amp;nbsp;Which order should you build them in? &amp;nbsp;How do you know, except through a lot of tedious snooping, which secondary dependencies are also involved in rebuilding the project dependencies?&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://code.google.com/p/hornget/"&gt;HornGet project&lt;/a&gt; is attempting (and succeeding I might add, even in its pre-beta form) to greatly ease the burden of updating dependencies of complex projects. &amp;nbsp;With Horn installed and configured, it only takes a single command line to get the latest of your favorite OSS project or to rebuild your project&amp;#39;s dependencies. &amp;nbsp;Similarly to &amp;quot;apt-get install,&amp;quot; you simply tell Horn what you&amp;#39;d like to have built and it does the rest. &amp;nbsp;There&amp;#39;s a full listing of all of Horn&amp;#39;s supported packages found at&amp;nbsp;&lt;a href="http://code.google.com/p/hornget/wiki/SupportedPackages"&gt;http://code.google.com/p/hornget/wiki/SupportedPackages&lt;/a&gt;. &amp;nbsp;As you can see, Horn supports a wide variety of projects such as NHibernate, Castle, LinFu, Ninject, AutoMapper, Subsonice, MVCContib, S#arp Architecture, and many others. &amp;nbsp;Something quite unique about Horn is that it even checks for indirect, bi-directional library dependencies. &amp;nbsp;For instance, NHibernate depends on a Castle project while one of the Castle projects depends on NHibernate. &amp;nbsp;Horn is smart enough (through config files) to know which projects to build in which order to resolve such scenarios.&lt;/p&gt;
&lt;p&gt;The best way to experience and appreciate Horn is to try it out. &amp;nbsp;The following steps demonstrate using Horn to automatically download and build the latest of NHibernate with updated dependencies:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install &lt;a href="http://tortoisesvn.net/downloads"&gt;TortoiseSVN&lt;/a&gt; (if you haven&amp;#39;t already) to download Horn and to be used during the build process.&lt;/li&gt;
&lt;li&gt;Install &lt;a href="http://code.google.com/p/msysgit/downloads/list"&gt;msysgit&lt;/a&gt; as some of the dependencies will be downloaded from from Git distributed source repositories.&lt;/li&gt;
&lt;li&gt;Make sure that &amp;quot;C:\Program Files\Git\bin&amp;quot; and&amp;nbsp;&amp;quot;C:\Program Files\Git\cmd&amp;quot;&amp;nbsp;are included in your Environment Variable&amp;#39;s PATH (and add them if not)&lt;/li&gt;
&lt;li&gt;Install &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx"&gt;Windows PowerShell&lt;/a&gt; (used during the dependency build process - it&amp;#39;s included in Win 2008 automatically)&lt;/li&gt;
&lt;li&gt;Open a PowerShell command prompt and run &amp;quot;set-ExecutionPolicy RemoteSigned&amp;quot; to allow Horn to invoke PowerShell commands used during the dependency build process.&lt;/li&gt;
&lt;li&gt;Use SVN command line or TortoiseSVN to get latest of&amp;nbsp;&lt;a href="http://hornget.googlecode.com/svn/trunk/"&gt;http://hornget.googlecode.com/svn/trunk/&lt;/a&gt; to a folder we&amp;#39;ll call HornRoot&lt;/li&gt;
&lt;li&gt;(Here&amp;#39;s the only&amp;nbsp;kludgey&amp;nbsp;part, which I&amp;#39;m sure will be cleverly resolved very soon...) &amp;nbsp;Open /HornRoot/src/Horn.Console/Program.cs in Notepad, or whatever, and modify, under GetRootFolderPath(), the line &amp;quot;var ret = new DirectoryInfo(rootFolder);&amp;quot; to be &amp;quot;var ret = new DirectoryInfo(@&amp;quot;C:\...\HornRoot\&amp;quot; + PackageTree.RootPackageTreeName);&amp;quot; and save/close the file - replacing C:\...HornRoot with a real file path. &amp;nbsp;&lt;strong&gt;NOTE&lt;/strong&gt;: &amp;nbsp;Make sure there are &lt;strong&gt;NO spaces&lt;/strong&gt; in the file path that you provide. &amp;nbsp;PowerShell abhors&amp;nbsp;spaces in file paths.&lt;/li&gt;
&lt;li&gt;Open a command prompt, cd to the /HornRoot/src folder and run &amp;quot;hornbuild.bat&amp;quot;...you be triumphantly rewarded with a BUILD SUCCEEDED message...but that&amp;#39;s just the Horn project.&lt;/li&gt;
&lt;li&gt;In the same command prompt, cd to /HornRoot/src/build/net-3.5/debug and run &amp;quot;horn&amp;quot;
&lt;ul&gt;
&lt;li&gt;You should see the Horn usage guidelines...that&amp;#39;s a good sign.&lt;/li&gt;
&lt;li&gt;At this point, Horn is now installed, ready and configured to build any of the supported packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;As an example, run &amp;quot;horn -install:nhibernate&amp;quot; (and &lt;strong&gt;be patient as it&amp;#39;ll take &lt;/strong&gt;&lt;strong&gt;some&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;to run&lt;/strong&gt;...30 minutes to an hour or more for a project with many dependencies is &lt;span style="text-decoration:line-through;"&gt;possible&lt;/span&gt; probable)
&lt;ul&gt;
&lt;li&gt;After executing this one liner, horn will spit out a whole bunch of &amp;quot;working......&amp;quot; statements as it figures out what NHibernate&amp;#39;s dependencies are, downloads the source of the dependencies, builds them, and then downloads and builds&amp;nbsp;NHibernate&amp;nbsp;with all of the updated dependencies.&lt;/li&gt;
&lt;li&gt;Keep waiting...Horn is doing a &lt;strong&gt;LOT &lt;/strong&gt;of tedious work for you right now. &amp;nbsp;Don&amp;#39;t be surprised if you see very long strings of &amp;quot;working......&amp;quot; statements at a time, throughout the build process; this is expected as it downloads each project dependency and builds them, accordingly. &amp;nbsp;Go get another cup of coffee or something.&lt;/li&gt;
&lt;li&gt;Assuming the OSS world is in a Zen-like state with each other you&amp;#39;ll get a number of BUILD SUCCEEDED messages for each project dependency and then eventually get a BUILD SUCCEEDED message for the target project itself.&lt;/li&gt;
&lt;li&gt;Horn outputs its results (the updated DLLs) into /HornRoot/.horn/result. &amp;nbsp;Don&amp;#39;t worry if there are more DLLs that you expected; just grab the updated ones that are applicable to your project and you&amp;#39;re good to go.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you&amp;#39;ve ever tried to update a bunch of project dependencies, you&amp;#39;ll appreciate the enormous time savings in using Horn to pull together the dependencies for you. &amp;nbsp;Doing this manually usually takes me at least a few hours to get latest of all dependencies, build them, and build them with S#arp Architecture. &amp;nbsp;With Horn, it takes a one liner and a coffee break.&lt;/p&gt;
&lt;p&gt;How does it do this magic you ask? &amp;nbsp;Good question! &amp;nbsp;Each project that Horn supports has a Boo configuration file; e.g., the S#arp Architecture Horn description is at&amp;nbsp;&lt;a href="http://hornget.googlecode.com/svn/trunk/package_tree/frameworks/sharp.architecture/sharp.architecture.boo"&gt;http://hornget.googlecode.com/svn/trunk/package_tree/frameworks/sharp.architecture/sharp.architecture.boo&lt;/a&gt;. &amp;nbsp;The file speaks for itself in describing what dependencies are necessary for the project and where to find the source of S#arp Architecture itself. &amp;nbsp;So when you run &amp;quot;horn -install:sharp.architecture&amp;quot; (which takes a very long while mind you) Horn references the respective project description file and off it goes. &amp;nbsp;It&amp;#39;s really quite a remarkable feat that Horn has pulled off.&lt;/p&gt;
&lt;p&gt;Horn is still maturing - it&amp;#39;s not even beta yet - but it&amp;#39;s quite a time saver already. &amp;nbsp;So if you have ideas, would like to get involved, or have a project that you&amp;#39;d like to have added to the roster, be sure to let the Horn team know.&lt;/p&gt;
&lt;p&gt;For more Horn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Project home: &amp;nbsp;&lt;a href="http://code.google.com/p/hornget/"&gt;http://code.google.com/p/hornget/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Discussion forum: &amp;nbsp;&lt;a href="http://groups.google.co.uk/group/horn-development"&gt;http://groups.google.co.uk/group/horn-development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;
&lt;p&gt;Billy McCafferty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53217" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/OX8m48VhD_8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Development+Tools/default.aspx">Development Tools</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Agile+Development/default.aspx">Agile Development</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/S_2300_arp+Architecture/default.aspx">S#arp Architecture</category><feedburner:origLink>http://devlicio.us/blogs/billy_mccafferty/archive/2009/10/29/the-horn-project-bringing-quot-apt-get-install-quot-to-net-projects.aspx</feedburner:origLink></item><item><title>Compiling Mapping using Fluent NHibernate</title><link>http://feedproxy.google.com/~r/Devlicious/~3/VbZ-RB_2s1A/compiling-mapping-using-fluent-nhibernate.aspx</link><pubDate>Thu, 29 Oct 2009 23:03:01 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53211</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This took me some time to find and work out so I am posting this in case I ever need again. I was getting mapping errors so wanted to see what Fluent NH spits out. &lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;public class FluentNHUtil
{
	string schemaExportPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, 
		&amp;quot;FluentNHMappings&amp;quot;);
	[Observation]
	public void compile_mappings_to_disk()
	{
		if (Directory.Exists(schemaExportPath))
			Directory.Delete(schemaExportPath, true);
		Directory.CreateDirectory(schemaExportPath);
		var model = new ReportingModelPersistenceMappingHandler().CreateModel();
		model.CompileMappings();
		model.WriteMappingsTo(schemaExportPath);		
	}
	
}
public class ReportingModelPersistenceMappingHandler
{
	public MappingConfiguration Handle(MappingConfiguration mappingConfiguration)
	{
		mappingConfiguration.AutoMappings.Add(CreateModel());
		mappingConfiguration.HbmMappings.AddFromAssembly(GetType().Assembly);
		return mappingConfiguration;
	}

	public AutoPersistenceModel CreateModel()
	{
		//the Components convention seems redundant but is dealing with an oddity in FluentNH
		return AutoMap.Assembly(GetType().Assembly)
			.Setup(s =&amp;gt;
					{
						s.IsComponentType = type =&amp;gt; type.Namespace.Contains(&amp;quot;Components&amp;quot;);
					})
			.Conventions.Add(
			new ReportingModelIdConvention(),
			DefaultLazy.Never(),
			new PluralizeTableNameConvention(),
			new HasManyDefaultConvention(),
			new LabNumberComponentConvention()
			).Where(t =&amp;gt; t.Namespace.Contains(GetNamespaceConvention()) &amp;amp;&amp;amp; t.Namespace.Contains(&amp;quot;Components&amp;quot;)==false);
	}

	private string GetNamespaceConvention()
	{
		return GetType().Namespace + &amp;quot;.Model&amp;quot;;
	}
}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53211" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/VbZ-RB_2s1A" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/mike_nichols/archive/2009/10/29/compiling-mapping-using-fluent-nhibernate.aspx</feedburner:origLink></item><item><title>It’s all about the delivery</title><link>http://feedproxy.google.com/~r/Devlicious/~3/mdY4LSlQGYU/it-s-all-about-the-delivery.aspx</link><pubDate>Thu, 29 Oct 2009 20:32:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53205</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>6</slash:comments><description>&lt;p&gt;   &lt;br /&gt;The Dependency Inversion Principle states:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;dl&gt;&lt;dd&gt;&lt;dl&gt;&lt;dd&gt;&lt;i&gt;A. High-level modules should not depend on low-level modules. Both should depend on abstractions.&lt;/i&gt;&lt;/dd&gt;&lt;dd&gt;&lt;i&gt;B. Abstractions should not depend upon details. Details should depend upon abstractions.&lt;/i&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;  &lt;br /&gt;(Source WikiPedia).   &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codinghorror.com/blog/archives/001225.html"&gt;Throw that at a terrible programmer&lt;/a&gt;, and all you&amp;rsquo;ll get is a terrible programmer that is annoyed and hates you. So true!&lt;/p&gt;
&lt;p&gt;Take the following method:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PrintHelloMessage()&lt;/pre&gt;
&lt;pre&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;Now ask a developer to add a new method to print the message &amp;lsquo;Goodbye&amp;rsquo;. Do you think he would do:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PrintGoodbyeMessage()&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Goodbye&amp;quot;&lt;/span&gt;);&lt;br /&gt;        }&lt;/pre&gt;
&lt;p&gt;
  &lt;br /&gt;or:&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PrintMessage(&lt;span class="kwrd"&gt;string&lt;/span&gt; message)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine(message);&lt;br /&gt;        }&lt;/pre&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;Most likely, he&amp;rsquo;d do the latter. Why? Because he realizes he&amp;rsquo;s gaining a benefit by passing a parameter to a method. He knows that if tomorrow you ask him for a &amp;ldquo;Good Afternoon&amp;rdquo; message, he won&amp;rsquo;t have to write a new method. &lt;/p&gt;
&lt;p&gt;What is Dependency Injection? It&amp;rsquo;s one way of complying with the Dependency Inversion Principle. However, when you think about it, what does it boil down to? Passing a parameter to a method, which happens to be a constructor. It seems simple enough doesn&amp;rsquo;t it? Yet, it&amp;rsquo;s hard for people to understand it. Why? because they don&amp;rsquo;t see the value in it. &lt;/p&gt;
&lt;p&gt;Explaining a principle to someone without them understanding the benefits and values they get out of it is useless, and that is why concepts such as Dependency Injection or Inversion of Control seem overly complex to the vast majority of developers (believe it or not, those of us that use these things are still a very big minority). It&amp;rsquo;s complex because they haven&amp;rsquo;t been explained the values of it. They&amp;rsquo;ve just been thrown some definition and they are expected to understand that it&amp;rsquo;s bad for one class to create an instance of another class it uses. &lt;/p&gt;
&lt;p&gt;Present a developer with the following code:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AuthServices&lt;/pre&gt;
&lt;pre&gt;    {&lt;/pre&gt;
&lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthUser(&lt;span class="kwrd"&gt;string&lt;/span&gt; username, &lt;span class="kwrd"&gt;string&lt;/span&gt; password)&lt;/pre&gt;
&lt;pre&gt;        {&lt;/pre&gt;
&lt;pre class="alt"&gt;            var authDAL = &lt;span class="kwrd"&gt;new&lt;/span&gt; AuthDAL();&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;            var user = authDAL.GetUserByUsername(username);&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (user != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;            {&lt;/pre&gt;
&lt;pre class="alt"&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; ...&lt;/pre&gt;
&lt;pre&gt;            }&lt;/pre&gt;
&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class="alt"&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;and ask them how they&amp;rsquo;d go about testing this code without having access to a database. Ask them how they&amp;rsquo;d go about changing AuthDAL for some fake DAL that doesn&amp;rsquo;t really connect to a database. &lt;/p&gt;
&lt;p&gt;They&amp;rsquo;ll probably come up with the solution of passing the AuthDAL class in as a parameter, and eventually realizing that multiple methods will use the same class, they&amp;rsquo;ll pass it in via the constructor and set it as an instance field. As long as their AuthDAL has virtual methods, they can create any fake DAL that overrides those methods and returns some dummy value. They might argue that they don&amp;rsquo;t want virtual methods. And that&amp;rsquo;s fine. Tell them to define the parameter as an interface. In fact, they probably have already heard of a principle that says that you should program to an interface and not a class. They&amp;rsquo;ll eventually end up with this code:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AuthServices&lt;br /&gt;    {&lt;br /&gt;        IAuthDAL authDAL;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; AuthServices(IAuthDAL authDAL)&lt;br /&gt;        {&lt;br /&gt;            _authDAL = authDAL;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthUser(&lt;span class="kwrd"&gt;string&lt;/span&gt; username, &lt;span class="kwrd"&gt;string&lt;/span&gt; password)&lt;br /&gt;        {&lt;br /&gt;            var user = _authDAL.GetUserByUsername(username);&lt;br /&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (user != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; ...&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And voila! You have Dependency Injection via Constructor. &lt;/p&gt;
&lt;p&gt;Once they *get* that, then explain to them other benefits, you know the real benefits they get from doing this: decoupled code, easy maintenance, promotion of SRP, etc.&amp;nbsp; and then throw the principle in their face:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;dl&gt;&lt;dd&gt;&lt;dl&gt;&lt;dd&gt;&lt;i&gt;A. High-level modules should not depend on low-level modules. Both should depend on abstractions.&lt;/i&gt; &lt;/dd&gt;&lt;dd&gt;&lt;i&gt;B. Abstractions should not depend upon details. Details should depend upon abstractions.&lt;/i&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And they&amp;rsquo;ll see how it all makes sense. &lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not about throwing or not throwing books. It&amp;rsquo;s about showing people how something can help them, how they get value of it. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53205" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/mdY4LSlQGYU" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/Design/default.aspx">Design</category><feedburner:origLink>http://devlicio.us/blogs/hadi_hariri/archive/2009/10/29/it-s-all-about-the-delivery.aspx</feedburner:origLink></item><item><title>Simple Kick Start Example using MEF (Preview 8)</title><link>http://feedproxy.google.com/~r/Devlicious/~3/ne0a-rD20Jk/simple-kick-start-example-using-mef-preview-8.aspx</link><pubDate>Tue, 27 Oct 2009 10:34:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53159</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;If your application needs extension points what do you do? Building a plugin based system is not cutting edge, it is not rocket science.&amp;#160; However, it does take a little effort and can be a bit painful depending on your implementation.&amp;#160; The guys at MS (Glen Block and crew) has been working on this kickin framework for about a year now called the &lt;a href="http://mef.codeplex.com/"&gt;Managed Extensibility Framework&lt;/a&gt; (most commonly known as MEF).&amp;#160; The core goal of MEF is to simplify the creation of extensible applications. MEF offers discovery and composition capabilities that you can leverage to load application extensions.&lt;/p&gt;  &lt;p&gt;There are a metric crap-ton of samples out on the net which show how to get running with MEF, however many of the posts are based off of older previews and most are also incomplete in terms of the code they show you on screen.&amp;#160; What I would like to do is provide a detailed how-to on getting your first (simple) MEF application up and running.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Goal of the demo code?&lt;/b&gt;     &lt;br /&gt;For this demo code we are going to put together a very simple rules plug-in engine.&amp;#160; The goal is to be able to add in a new IRule at any point and have your application pick it up.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;What is needed?      &lt;br /&gt;&lt;/b&gt;If you have not already done so head out to &lt;a title="http://mef.codeplex.com/" href="http://mef.codeplex.com/"&gt;http://mef.codeplex.com/&lt;/a&gt; and grab the latest source download.&amp;#160; More than likely you will need to download and compile all the source in order to get working binaries (hey, it is a preview after all).&amp;#160; Once you have compiled the source you need to grab the output from the ComponentModel project (assembly name is System.ComponentModel.Composition) and include this into your project.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Putting it together?&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Creating the rule Interface : IRule &lt;/i&gt;    &lt;br /&gt;This is needed because in order to define a plug-in you need to define what that plug-in looks like. &lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;public interface IRule
{
    void DoIt();
    string Name { get; }
    string Version { get; }
    string Description { get; }
}&lt;/pre&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;i&gt;Creating a rule instance (or two) 
    &lt;br /&gt;&lt;/i&gt;Now that we have our rule interface we need to create specific instances of the rule and mark them for export.&amp;#160; Marking them for Export simply entails adding a attribute provided by the MEF framework and this attribute allows you to describe your plug-in to the MEF framework so it can pick it up. &lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[Export( typeof( IRule ) )]
internal class RuleInstance1 : IRule
{
    public void DoIt() {}

    public string Name
    {
        get { return &amp;quot;Rule Instance 1&amp;quot;; }
    }

    public string Version
    {
        get { return &amp;quot;1.0.0.0&amp;quot;; }
    }

    public string Description
    {
        get { return &amp;quot;Some Rule Instance&amp;quot;; }
    }
}

[Export( typeof( IRule ) )]
public class RuleInstance2 : IRule
{
    public void DoIt() {}

    public string Name
    {
        get { return &amp;quot;Rule Instance 3&amp;quot;; }
    }

    public string Version
    {
        get { return &amp;quot;1.1.0.0&amp;quot;; }
    }

    public string Description
    {
        get { return &amp;quot;Some Rule Instance&amp;quot;; }
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;i&gt;Creating the holder for all your plug-ins 
    &lt;br /&gt;&lt;/i&gt;In order to have your application know about the plug-ins that MEF has found you need to define a storage location for them.&amp;#160; We will do this by creating a property of IList&amp;lt;IRule&amp;gt; which will hold each instance.&amp;#160; When we create this storage location we need to tell MEF that we are going to use this as a storage location and to do this you need to mark it with the ImportMany (use this attribute if you want a collection, use Import for only a single instance) attribute.&amp;#160; This is another special attribute provided by the MEF framework. &lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[ImportMany( typeof( IRule ) )]
internal IList&amp;lt;IRule&amp;gt;: _rules { get; set ;}&lt;/pre&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;i&gt;Creating the logic to load the plugin 
    &lt;br /&gt;&lt;/i&gt;Now that we have all the heavy lifting out of the way in terms of defining our Imports and Exports it is time to setup our application to consume the data.&amp;#160; It is here where you tell MEF where to look to find your exports (plug-ins) and what to do with them once you have found them. &lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public void Init()
{
    var catalog = new AggregateCatalog();
    var container = new CompositionContainer( catalog );
    var batch = new CompositionBatch();
    batch.AddPart( this );
    // because all our types are in the same assembly we simply use the current one.    
    catalog.Catalogs.Add( new AssemblyCatalog( Assembly.GetExecutingAssembly() ) );
    container.Compose( batch );
    foreach ( var rule in _rules )
    {
        Debug.WriteLine( rule.Name );
    }
}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Wrapping it up 
    &lt;br /&gt;&lt;/b&gt;As you can see getting a simple example of MEF up and running is a pretty simple task (great job MEF team).&amp;#160; You should be able to get this up and running in about 10 minutes.&amp;#160; You should also have all the code you need in order to get this running.&amp;#160; I hope this helps kick-start someone’s learning and adoption of MEF.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53159" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/ne0a-rD20Jk" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Agile/default.aspx">Agile</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/MEF/default.aspx">MEF</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/27/simple-kick-start-example-using-mef-preview-8.aspx</feedburner:origLink></item><item><title>Caliburn v1 RTW for WPF, Silverlight 2.0 and 3.0!</title><link>http://feedproxy.google.com/~r/Devlicious/~3/lD8FExQNbWw/caliburn-v1-rtw-for-wpf-silverlight-2-0-and-3-0.aspx</link><pubDate>Mon, 26 Oct 2009 17:06:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53139</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>9</slash:comments><description>&lt;p&gt;Hooray!!! I finally &lt;a href="http://caliburn.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34985"&gt;released Caliburn v1 to RTW&lt;/a&gt; and got &lt;a href="http://www.caliburnproject.org/"&gt;the official site launched&lt;/a&gt;! This has been a long time coming and I could not have done it without the generous help and support of the .NET community, family and friends.&amp;nbsp; Many individuals contributed by finding bugs, submitting patches, recommending features or improvements and providing general support and encouragement.&amp;nbsp; I would like to call out a few special individuals (in no particular order) who contributed significantly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Michael Davis &amp;ndash; For submitting numerous bug fixes and patches. &lt;/li&gt;
&lt;li&gt;&lt;a href="http://devlicio.us/controlpanel/blogs/posteditor.aspx/rauhski.blogspot.com"&gt;Ryan Rauh&lt;/a&gt; &amp;ndash; For creating the fabulous Prism integration module, which I believe makes &lt;a href="http://compositewpf.codeplex.com/"&gt;Prism&lt;/a&gt; easier to use with Caliburn than without! &lt;/li&gt;
&lt;li&gt;&lt;a href="http://marcoamendola.wordpress.com/"&gt;Marco Amendola&lt;/a&gt; &amp;ndash; For implementing several new features, fixing tons of bugs, submitting patches, writing demos and being an awesome help answering questions on the forums! &lt;/li&gt;
&lt;li&gt;&lt;a href="http://devlicio.us/blogs/christopher_bennage/default.aspx"&gt;Christopher Bennage&lt;/a&gt; &amp;ndash; For fixing bugs, inventing and inspiring cool features, participating in the forums, believing in my vision and being willing to put this framework to the test on every WPF/SL application our company has built for the last several years. &lt;/li&gt;
&lt;li&gt;Anna Eisenberg &amp;ndash; It goes without saying that my wife has been very gracious to me.&amp;nbsp; She has supported and believed in me and my work without faltering.&amp;nbsp; I love you! &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I would also like to thank the codeplex users MichaelDBang, Bezieur, p_matyjasek and davidpadbury for their patches and participation in the forums.&amp;nbsp; And, as always, if I left someone out, I sincerely apologize.&amp;nbsp; (I&amp;rsquo;m going to do a better job of tracking this stuff for v2&amp;hellip;)&lt;/p&gt;
&lt;p&gt;In addition to &lt;a href="http://caliburn.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34985"&gt;the release build&lt;/a&gt; and &lt;a href="http://www.caliburnproject.org/"&gt;the official site&lt;/a&gt;, we&amp;rsquo;ve added a gallery of &lt;a href="http://caliburn.codeplex.com/wikipage?title=Products&amp;amp;referringTitle=Documentation"&gt;applications&lt;/a&gt; and &lt;a href="http://caliburn.codeplex.com/wikipage?title=BlogsArticlesProjects&amp;amp;referringTitle=Documentation"&gt;related projects&lt;/a&gt; to our &lt;a href="http://caliburn.codeplex.com/documentation"&gt;new documentation&lt;/a&gt;.&amp;nbsp; In the coming months I am going to be extending this documentation with additional articles in my &lt;a href="http://www.caliburnproject.org/"&gt;MVVM series&lt;/a&gt; as well as some cool tutorials.&lt;/p&gt;
&lt;p&gt;For those of you who have never heard of Caliburn, it is a UI framework designed to aid in the development of WPF and Silverlight applications. Caliburn implements a variety of UI patterns for solving real-world problems. Patterns that are enabled by the framework include MVC, MVP, Presentation Model (MVVM), Commands and Application Controller.&amp;nbsp; Here&amp;rsquo;s a bullet point list of what Caliburn gives you that you don&amp;rsquo;t get from WPF/SL out of the box:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Extends databinding to methods, making MVVM architectures simple and intuitive. &lt;/li&gt;
&lt;li&gt;Adds pre/post execution filters and rescues to MVVM actions. &lt;/li&gt;
&lt;li&gt;Simplifies asynchronous programming through a powerful implementation of Coroutines. &lt;/li&gt;
&lt;li&gt;Provides base classes supporting common UI roles such as Screen Activator, Screen Conductor, Screen Collection and Application Controller. &lt;/li&gt;
&lt;li&gt;Encourages a convention over configuration approach to architecting solutions. &lt;/li&gt;
&lt;li&gt;Supports TDD by providing a powerful databinding validation framework for WPF. &lt;/li&gt;
&lt;li&gt;Enables use of the same API for WPF and Silverlight architectures &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here&amp;rsquo;s a more detailed explanation of its key features:&lt;/p&gt;
&lt;h5&gt;Actions&lt;/h5&gt;
&lt;p&gt; Actions extend the databinding capabilities of WPF/SL by enabling a UI to bind not only to data but to methods as well. Caliburn provides a consistent API for wiring events, gestures, and attached events to methods on a presentation-related class. This type of method binding removes much of the glue code involved in building an &lt;a href="http://en.wikipedia.org/wiki/Model_View_Presenter"&gt;MVP&lt;/a&gt; or &lt;a href="http://martinfowler.com/eaaDev/PresentationModel.html"&gt;Presentation Model&lt;/a&gt; (MVVM) architecture. In addition to basic execution of methods, Caliburn&amp;#39;s action mechanism can pass data from the UI into the methods as parameters and bind return values back to the UI. A filter mechanism (similar to ASP.NET MVC) exists for decorating methods. Filters can affect the availability of a given action through the UI, which can be represented by automatically disabling, hiding or collapsing controls. Caliburn can also automatically execute methods asynchronously, and execute callbacks. It does all the thread marshalling for you. If that&amp;#39;s not enough power, you can take advantage of Caliburn&amp;#39;s Coroutine implementation through actions as well.   &lt;/p&gt;
&lt;h5&gt;Commands&lt;/h5&gt;
&lt;p&gt; Caliburn&amp;#39;s command implementation is an alternative to WPF&amp;#39;s and supplies very useful functionality that is altogether missing from Silverlight. As you might expect, it is an implementation of the &lt;a href="http://en.wikipedia.org/wiki/Command_pattern"&gt;Command Pattern.&lt;/a&gt;. Commands are built on top of Actions and thus share many of the same features, including multiple input parameters, filters and automatic asynchronous execution. Additionally, commands can be created in hierarchies, such that a parent command can execute multiple child commands. The parent command&amp;#39;s availability can also be affected by its children in various ways. There are two types of composite commands available out of the box, but the mechanism is extensible.   &lt;/p&gt;
&lt;h5&gt;Application Model&lt;/h5&gt;
&lt;p&gt; Caliburn supports UI architectures based on MVP and MVVM through its various implementations of the IPresenter interface. Often times, these types of architectures involve tricky UI lifecycle issues such as handling activation, deactivation and shutdown semantics for various UI components. The basic logic for handling these scenarios is found in Caliburn&amp;rsquo;s Presenter, PresenterManager, MultiPresenter, MultiPresenterManager and Navigator classes. By composing these classes you can create a hierarchical model representing the entire runtime state of your application. In Silverlight, you can even use the browser as an Application Controller with Caliburn&amp;rsquo;s support for deep linking. By using these classes as a starting point, you can very quickly get up in running with an MVP or MVVM architecture.   &lt;/p&gt;
&lt;h5&gt;Conventions&lt;/h5&gt;
&lt;p&gt; Convention over configuration is a way to leverage a great deal of a framework&amp;#39;s power without having to go through tons of tedious configuration or setup code. Caliburn has basic conventions around view discovery, binding of actions and building-up of hierarchical View Models. These are all implemented through well-known services which are easily replaceable or extendable with your own conventions.   &lt;/p&gt;
&lt;h5&gt;Testability&lt;/h5&gt;
&lt;p&gt; One of the goals of Caliburn is to make it easier to build applications right. To this effect, Caliburn has features geared around &lt;a href="http://en.wikipedia.org/wiki/Unit_test"&gt;unit testing&lt;/a&gt;. There is currently rich support for testing databindings in WPF and a simple fluent interface for verifying change notification on model objects. Unit tests for view bindings give the developer the confidence they need to refactor their models, knowing that they will be aware of broken bindings before they run the application. Not only will they be aware that the bindings are broken, but Caliburn&amp;rsquo;s binding validator will tell you exactly where the problem is in the UI hierarchy and what the specific error was.   &lt;/p&gt;
&lt;h5&gt;Utilities&lt;/h5&gt;
&lt;p&gt;Various utility classes and extension methods are provided as part of Caliburn. The most popular of which is the Execute static class, which enables a developer to easily execute code on a background thread or on the UI thread.&lt;/p&gt;
&lt;p&gt;Caliburn has come a long was since I first started working on it about three years ago and we are not finished yet.&amp;nbsp; I&amp;rsquo;ve got a host of ideas for v2 and now is a great time to get started.&amp;nbsp; &lt;a href="http://caliburn.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=34985"&gt;Download the framework&lt;/a&gt;.&amp;nbsp; Start using it to build UI&amp;rsquo;s, give me feedback and help us make it even better in v2!&lt;/p&gt;
&lt;p&gt;With Much Gratitude (and hoping this makes your work a little easier),&lt;/p&gt;
&lt;p&gt;Rob Eisenberg&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53139" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/lD8FExQNbWw" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/DSL/default.aspx">DSL</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2009/10/26/caliburn-v1-rtw-for-wpf-silverlight-2-0-and-3-0.aspx</feedburner:origLink></item><item><title>NHibernate CurrentSessionContext tip</title><link>http://feedproxy.google.com/~r/Devlicious/~3/lIZ18zIF9vk/nhibernate-currentsessioncontext-tip.aspx</link><pubDate>Sun, 25 Oct 2009 04:32:16 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53088</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I recently implemented a reporting model in my app (a windows service) and so now have two session factories to manage within a unit of work. Originally, I was using this setting:&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;property name=&amp;quot;current_session_context_class&amp;quot;&amp;gt;&lt;b&gt;thread_static&lt;/b&gt;&amp;lt;/property&amp;gt;&lt;/pre&gt;

&lt;p&gt;This was causing the wrong session to get injected into my entities since only one session factory is supported with this setting. So I changed it to this:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;property name=&amp;quot;current_session_context_class&amp;quot;&amp;gt;&lt;b&gt;call&lt;/b&gt;&amp;lt;/property&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now things work as expected. You don’t want to use this on ASP.NET.&lt;/p&gt;

&lt;h3&gt;Resources&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://nhforge.org/doc/nh/en/index.html#architecture-current-session" target="_blank"&gt;NH docs&lt;/a&gt; on Contextual sessions &lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53088" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/lIZ18zIF9vk" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/NHibernate/default.aspx">NHibernate</category><feedburner:origLink>http://devlicio.us/blogs/mike_nichols/archive/2009/10/24/nhibernate-currentsessioncontext-tip.aspx</feedburner:origLink></item><item><title>Virtual Errors From The Crypt</title><link>http://feedproxy.google.com/~r/Devlicious/~3/I2NbcWD_qj8/virtual-errors-from-the-crypt.aspx</link><pubDate>Sun, 25 Oct 2009 04:03:38 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53086</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Resuming a Win 2K3 session on VMWare 6.5.2 and got an interesting error:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;VMware Workstation unrecoverable error: (vmx)     &lt;br /&gt;NOT_IMPLEMENTED d:/build/ob/bora-156735/bora/devices/mainmem/mainMemCpt.c:850      &lt;br /&gt;A log file is available in &amp;quot;F:\VirtualMachines\VMWare\Windows\Server2003R2\DevBAK\vmware.log&amp;quot;.&amp;#160; A core file is available in &amp;quot;F:\VirtualMachines\VMWare\Windows\Server2003R2\DevBAK\vmware-vmx-984.dmp&amp;quot;.&amp;#160; Please request support and include the contents of the log file and core file.&amp;#160; &lt;br /&gt;To collect data to submit to VMware support, select Help &amp;gt; About and click &amp;quot;Collect Support Data&amp;quot;. You can also run the &amp;quot;vm-support&amp;quot; script in the Workstation folder directly.      &lt;br /&gt;We will respond on the basis of your support entitlement.&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I started digging around and found some links but none helped resolve my issue. The problem is, my machine was in suspended state. I have a backup but I forgot to &lt;strong&gt;git commit&lt;/strong&gt; before shutting down last night…lame. &lt;/p&gt;  &lt;p&gt;So I just deleted the .vmss file in the VM folder that informs the suspended state and the machine boots up fine now. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53086" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/I2NbcWD_qj8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/VMWare/default.aspx">VMWare</category><feedburner:origLink>http://devlicio.us/blogs/mike_nichols/archive/2009/10/24/virtual-errors-from-the-crypt.aspx</feedburner:origLink></item><item><title>Can anyone spot what is wrong here?</title><link>http://feedproxy.google.com/~r/Devlicious/~3/1cDfq5bZSyE/can-anyone-spot-what-is-wrong-here.aspx</link><pubDate>Fri, 23 Oct 2009 11:40:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:53019</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;4 Advil later and my head really hurts.&amp;#160; Here is a little story about how a simple little typo can really cause major headaches and pain.&lt;/p&gt;  &lt;p&gt;Yesterday I was in the process of setting up one of our new WCF services to use Jimmy Bogard’s &lt;a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/07/29/integrating-structuremap-with-wcf.aspx"&gt;solution to use StructureMap&lt;/a&gt; to create our services.&amp;#160; At one point during my development I had the setup correct because when I would do a ObjectFactory.WhatDoIHave() I could see the output.&amp;#160; However, a few minutes later everything was broke.&amp;#160; Not knowing what had changed (I had not yet committed anything to svn so I could not do a compare even) I did what most developers do, I tried it again and again just hoping it would magically work. (ok, what I really did was kill the dev web server, restarted IIS, restarted VS, etc).&amp;#160; After about 30 minutes of trying to determine what had changed I finally went home for the night, hoping that a new day would magically solve the problems.&lt;/p&gt;  &lt;p&gt;Well, when I came in today the problem was still there (looks like my laptop &lt;a href="http://en.wikipedia.org/wiki/Gremlins"&gt;Gremlins&lt;/a&gt; took the night off.&lt;/p&gt;  &lt;p&gt;Can you spot what is wrong with this code?&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;ObjectFactory.Configure( 
    scanner =&amp;gt;
        {
            scanner.AddRegistry( new IoCDataStrategyRegistry() );
            scanner.AddRegistry( new IoCLicensingRegistry() );
            
        }
    );&lt;/pre&gt;

&lt;p&gt;Did you see the error?&amp;#160; It is subtle.&amp;#160; Ok, give up, take a look at this code&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;ObjectFactory.Initialize( 
    scanner =&amp;gt;
        {
            scanner.AddRegistry( new IoCDataStrategyRegistry() );
            scanner.AddRegistry( new IoCLicensingRegistry() );
            
        }
    );&lt;/pre&gt;

&lt;p&gt;Turns out that StructureMap does not puke when you use the DSL syntax in an incorrect manor.&amp;#160; What it does do however is simply not wire up correctly, which makes sense.&lt;/p&gt;

&lt;p&gt;Anyway, not that my head hurts, but my code is back to normal I guess it is time to move on to the next issue.&lt;/p&gt;

&lt;p&gt;Till next time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=53019" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/1cDfq5bZSyE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/StructureMap/default.aspx">StructureMap</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Humor/default.aspx">Humor</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/23/can-anyone-spot-what-is-wrong-here.aspx</feedburner:origLink></item><item><title>Castle Windsor forwarded types and proxies</title><link>http://feedproxy.google.com/~r/Devlicious/~3/Jd3IUb2Zyp4/castle-windsor-forwarded-types-and-proxies.aspx</link><pubDate>Thu, 22 Oct 2009 19:41:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52967</guid><dc:creator>Krzysztof Koźmic</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Castle Windsor allows you to use single component for multiple services, which is called Forwarded Types.&lt;/p&gt;  &lt;h3&gt;Forwarded Types&lt;/h3&gt;  &lt;p&gt;In other words, you can tell Windsor – when IFoo is requested use FooBar as implementation, and when Bar is requested also use FooBar (when using default lifestyle of singleton you’ll get the same instance).&lt;/p&gt;  &lt;p&gt;Here’s some code:&lt;/p&gt;  &lt;pre class="c-sharp" name="code"&gt;var container = new WindsorContainer();
container.Register(Component.For&amp;lt;Bar&amp;gt;().Forward&amp;lt;IFoo&amp;gt;()
                       .ImplementedBy&amp;lt;FooBar&amp;gt;());
var foo = container.Resolve&amp;lt;IFoo&amp;gt;();
var bar = container.Resolve&amp;lt;Bar&amp;gt;();
Debug.Assert(foo == bar);
foo.DoFoo();
bar.DoBar();
Console.ReadKey(true);&lt;/pre&gt;

&lt;h3&gt;Proxies&lt;/h3&gt;

&lt;p&gt;What if you want to use proxies for that component though?&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;var container = new WindsorContainer();
container.Register(Component.For&amp;lt;IInterceptor&amp;gt;()
                       .Named(&amp;quot;interceptor&amp;quot;)
                       .ImplementedBy&amp;lt;FooBarInterceptor&amp;gt;(),
                   Component.For&amp;lt;bar&amp;gt;().Forward&amp;lt;ifoo&amp;gt;()
                       .ImplementedBy&amp;lt;FooBar&amp;gt;()
                       .Interceptors(new InterceptorReference(&amp;quot;Interceptor&amp;quot;)).Anywhere);
var foo = container.Resolve&amp;lt;IFoo&amp;gt;();
var bar = container.Resolve&amp;lt;Bar&amp;gt;();
Debug.Assert(foo == bar);
foo.DoFoo();
bar.DoBar();
Console.ReadKey(true);&lt;/pre&gt;

&lt;p&gt;Now, what happens next depends on how you implemented the interface IFoo on class FooBar. Say this is FooBar:&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;public class FooBar : Bar, IFoo
{
    public void DoFoo()
    {
        Console.WriteLine(&amp;quot;DoFoo&amp;quot;);
    }
 
    public override void DoBar()
    {
        Console.WriteLine(&amp;quot;DoBar&amp;quot;);
    }
}&lt;/pre&gt;

&lt;p&gt;Notice that DoFoo is non-virtual. In this case, here’s what we’re gonna get.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/krzysztof_5F00_kozmic/windsor_5F00_1_5F00_49C82140.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="windsor_1" border="0" alt="windsor_1" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/krzysztof_5F00_kozmic/windsor_5F00_1_5F00_thumb_5F00_09949877.png" width="316" height="178" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;DoFoo did not get intercepted. So what’s the issue here, and how do we fix it?&lt;/p&gt;

&lt;h3&gt;The What&lt;/h3&gt;

&lt;p&gt;When you forward a registration, Windsor runs just the first type through the complete registration pipeline, and subsequent forwarded types are treated just as additional piece of data “Oh, by the way, use this component I just registered for this type as well&amp;quot;. Proxy registration is a part of the component model building, and since we end up having just one component only information about its main type gets recorded for proxying.&lt;/p&gt;

&lt;p&gt;While this might appear at first clearly as a bug, I think it’s rather a by-design feature. Forcing Windsor to figure it out by itself could pretty quickly become very tricky and we might not always get what we expected. There are however ways of getting what we want.&lt;/p&gt;

&lt;h3&gt;The fix no 1&lt;/h3&gt;

&lt;p&gt;Now that we know what we’re up against, how do we fix it? First and the most trivial fix would be simply to make the DoFoo virtual – this way it would get picked when proxying Bar base class and we could successfully proxy it. While this may not always be applicable (you may not be able to modify the class) this is the only option that is available if you’re using the released version. However if you’re using trunk there are two more possible ways of bending it to our will.&lt;/p&gt;

&lt;h3&gt;Meet my attributes&lt;/h3&gt;

&lt;p&gt;Due to some changes in how Dynamic Proxy 2.2 (current trunk) handles additional interfaces to proxy, it is possible to intercept non-virtually implemented interface members on a class proxy. Since Windsor by default will request just the class proxy (with no additional interfaces) we need to tell it to toss an IFoo attribute in as well. The quickest way of doing it is throwing an attribute on top of our class:&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;[ComponentProxyBehavior(AdditionalInterfaces = new[] { typeof(IFoo) })]
public class FooBar : Bar, IFoo
{
    public void DoFoo()
    {
        Console.WriteLine(&amp;quot;DoFoo&amp;quot;);
    }
 
    public override void DoBar()
    {
        Console.WriteLine(&amp;quot;DoBar&amp;quot;);
    }
}&lt;/pre&gt;

&lt;p&gt;If we run the code now we’ll get this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/krzysztof_5F00_kozmic/windsor_5F00_2_5F00_78AFF486.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="windsor_2" border="0" alt="windsor_2" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/krzysztof_5F00_kozmic/windsor_5F00_2_5F00_thumb_5F00_5897787A.png" width="268" height="178" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is not a solution most people would choose anyway. Even if you can do it (your service does not come from a 3rd party library), you’re decorating your service class with a Windsor-specific attribute which many consider an anti-pattern. There’s however a third, more pure way.&lt;/p&gt;

&lt;p&gt;Remember that you need trunk version of Dynamic Proxy for this to work. If you use version 2.1 you’ll end up with this instead:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/krzysztof_5F00_kozmic/windsor_5F00_3_5F00_15BB3400.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="windsor_3" border="0" alt="windsor_3" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/krzysztof_5F00_kozmic/windsor_5F00_3_5F00_thumb_5F00_12A8D60B.png" width="475" height="290" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Windsor will implement the interface, but it will treat it as interface proxy without target. You can make it work by inserting a dedicated interceptor that will forward the calls to your class, but it’s something you’ll have to do manually all the way through.&lt;/p&gt;

&lt;h3&gt;Black belt approach&lt;/h3&gt;

&lt;p&gt;I said that forwarded types don’t get ran through whole registration pipeline. However, kernel does raise its component lifecycle events for them, so we can hook up to them and get notified when our forwarding handler gets registered, and modify its component model.&lt;/p&gt;

&lt;p&gt;We start by hooking up to kernels HandlerRegistered event, before we register any components.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;
var container = new WindsorContainer();
container.Kernel.HandlerRegistered += OnHandlerRegistered;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;In the OnHandlerRegistered method we check whether the handler at hand is a ForwardingHandler and if so we add its interface to the list of additional interfaces we want to proxy, just like we did using attribute in the example above.&lt;/p&gt;

&lt;pre class="c-sharp" name="code"&gt;static void OnHandlerRegistered(Castle.MicroKernel.IHandler handler, ref bool stateChanged)
{
    var forwardingHandler = handler as ForwardingHandler;
 
    if (forwardingHandler == null)
        return; //we&amp;#39;re only interested in forwarding handlers...
 
    if(!forwardingHandler.Service.IsInterface)
        return; //we&amp;#39;re only interested in interface services...
 
    var targetHandler = forwardingHandler.Target;
    if(!targetHandler.ComponentModel.ExtendedProperties.Contains(ProxyConstants.ProxyOptionsKey))
        return; //apparently this service is not registered for proxying
 
    var options = targetHandler.ComponentModel.ExtendedProperties[ProxyConstants.ProxyOptionsKey] as ProxyOptions;
    Debug.Assert(options != null);
 
    options.AddAdditionalInterfaces(forwardingHandler.Service);
}&lt;/pre&gt;

&lt;p&gt;Now we get our interface proxied without having to touch our component’ code.&lt;/p&gt;

&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:55ae3962-ae22-4247-bc0c-ae91528a8244" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Castle+Windsor" rel="tag"&gt;Castle Windsor&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52967" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/Jd3IUb2Zyp4" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/krzysztof_kozmic/archive/tags/Castle/default.aspx">Castle</category><feedburner:origLink>http://devlicio.us/blogs/krzysztof_kozmic/archive/2009/10/22/castle-windsor-forwarded-types-and-proxies.aspx</feedburner:origLink></item><item><title>Lambdas aren’t just for managed code</title><link>http://feedproxy.google.com/~r/Devlicious/~3/5gLr-JKAUF8/lambdas-aren-t-just-for-managed-code.aspx</link><pubDate>Wed, 21 Oct 2009 23:50:29 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52899</guid><dc:creator>Scott Seely</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;A long time ago, I was a C++ developer. I actually thought of myself as a pretty darn good C++ developer and got way too excited when I finally got to meet folks like Scott Meyers and actually landed a job working with Bobby Schmidt—same team on MSDN. (If you know Bobby’s name, well, you were pretty deep into C++ circa 1999.) Then, like many C++ devs, I moved over to a garbage collected language. I’ve done more than my fair share of professional .NET and Java development. C++ has been left by the wayside. Today, I finally downloaded and installed Visual Studio 2010 Beta 2. I dug into the “What’s New” and, out of curiosity, decided to look at C++ first (I already know about many of the C# and VB changes). I saw two cool things:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;C++ now has an auto keyword. For you C# devs, it is pretty much the same as the C# var keyword. &lt;/li&gt;    &lt;li&gt;C++ has lambdas. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now, I’m only a little ways into understanding C++ lambdas, so some of my information here may be suspect. The C++ lambda is just an anonymous function. You can pass variables into the function so that the variable is visible within the function. The syntax is:&lt;/p&gt;  &lt;p&gt;[ &lt;em&gt;list of variables from current scope to pass into lambda scope&lt;/em&gt; ] &lt;em&gt;return-type&lt;/em&gt;( &lt;em&gt;function signature&lt;/em&gt; ) { &lt;em&gt;code&lt;/em&gt; }&lt;/p&gt;  &lt;p&gt;The canonical example appears to be std::for_each from &amp;lt;algorithm&amp;gt;. &lt;/p&gt; &lt;code&gt;   &lt;p&gt;#include &amp;quot;stdafx.h&amp;quot;      &lt;br /&gt;#include &amp;lt;iostream&amp;gt;       &lt;br /&gt;#include &amp;lt;algorithm&amp;gt;       &lt;br /&gt;#include &amp;lt;vector&amp;gt;       &lt;br /&gt;using namespace std; &lt;/p&gt;    &lt;p&gt;int _tmain(int argc, _TCHAR* argv[])      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; vector&amp;lt;int&amp;gt; myints;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for (auto i = 0; i &amp;lt; 10; ++i){       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; myints.push_back(i);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; auto number = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; auto numSquared = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for_each(myints.begin(), myints.end(), [&amp;amp;number, &amp;amp;numSquared](int n) {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; n &amp;lt;&amp;lt; endl;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; number += n;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; numSquared += n * n;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; });       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; &amp;quot;The sum is &amp;quot; &amp;lt;&amp;lt; number &amp;lt;&amp;lt; endl;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; cout &amp;lt;&amp;lt; &amp;quot;The sum of the squares is &amp;quot; &amp;lt;&amp;lt; numSquared &amp;lt;&amp;lt; endl;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return 0;       &lt;br /&gt;}&lt;/p&gt; &lt;/code&gt;  &lt;p&gt;In this example, I have two values: number and numSquared. I make references of the value visible to the lambda, which prints out each value as it comes through and then sums the numbers and their squares. Once the function completes, the code emits the values to the console window. If you don’t want to pass anything to the lambda, you still need to state this. If I didn’t want number or numSquared visible, the lambda signature would be:&lt;/p&gt; &lt;code&gt;   &lt;p&gt;[](int n){}&lt;/p&gt; &lt;/code&gt;  &lt;p&gt;At some point, I’ll dig in and see what else this is good for, including how to build my own Functor signatures. Anyhow, just thought I’d share this little nugget with you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52899" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/5gLr-JKAUF8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://devlicio.us/blogs/scott_seely/archive/tags/VS+2010/default.aspx">VS 2010</category><feedburner:origLink>http://devlicio.us/blogs/scott_seely/archive/2009/10/21/lambdas-aren-t-just-for-managed-code.aspx</feedburner:origLink></item><item><title>IE6 still haunts me</title><link>http://feedproxy.google.com/~r/Devlicious/~3/jCM3NVszGCM/ie6-still-haunts-me.aspx</link><pubDate>Wed, 21 Oct 2009 22:16:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52894</guid><dc:creator>sergiopereira</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Oh, the woes of supporting IE6 (or, better put, IE666 &amp;mdash; the browser of the beast.)&lt;/p&gt;

&lt;p&gt;
	Halloween is definitely upon us. Today I spent a good chunk of time trying to identify the source of a problem in
	my application. Right now I&amp;#39;m in the process of jQuery-fying some legacy JavaScript,
	which includes Ajax calls and error handling logic.
&lt;/p&gt;
&lt;p&gt;
	At some point I needed to pop-up a DIV that was supposed to look like a modal message box,
	reporting some error that happened during the Ajax call. That was not hard at all. I used
	the &lt;a href="http://www.ericmmartin.com/projects/simplemodal/"&gt;SimpleModal&lt;/a&gt; plugin and
	got the message box up in not time at all.
&lt;/p&gt;
&lt;h3&gt;Not so fast, you have IE6 users&lt;/h3&gt;
&lt;p&gt;
	As with many web developers out there, I don&amp;#39;t have the luxury of ignoring IE6 users because
	they are upwards of 60% of our user base (corporate users that for some reason can&amp;#39;t easily
	upgrade their browsers.)
&lt;/p&gt;
&lt;p&gt;
	I thought it wouldn&amp;#39;t be a problem because the SimpleModal plugin handles a number of IE6 issues,
	including the insertion of an &lt;code&gt;IFrame&lt;/code&gt; to overcome the bleedthrough of &lt;code&gt;Select&lt;/code&gt; tags.
	But of course it couldn&amp;#39;t be that easy right?
&lt;/p&gt;
&lt;p&gt;
In some of my tests IE6 was simply &lt;b&gt;crashing&lt;/b&gt; when I tried to open the &amp;quot;modal&amp;quot; message. After a lot or hair 
pulling, I saw this suspicious HTML in one of my messages:
&lt;/p&gt;
&lt;pre name="code" class="html"&gt;&amp;lt;table style=&amp;quot;font-size: expression(parentnode.currentstyle.fontsize);&amp;quot; &amp;gt;
    &amp;lt;!-- rest of the table is normal --&amp;gt;
&amp;lt;/table&amp;gt;&lt;/pre&gt;

&lt;p&gt;
	Sure enough, moving that &lt;i&gt;hack&lt;/i&gt; to a proper CSS rule in the external .css file made the error go away.
	We shouldn&amp;#39;t be using dynamic CSS expressions anyway, since 
	&lt;a href="http://blogs.msdn.com/ie/archive/2008/10/16/ending-expressions.aspx"&gt;they were removed from IE8&lt;/a&gt;, 
	so I went ahead and ditched that kind of usage wherever I could find it.
&lt;/p&gt;

&lt;p&gt;This is just to keep us on our toes regarding IE6 support. Even though the modern JavaScript libraries go
to great lengths to support IE6 and make our coding transparent, nothing substitutes good old manual testing
to make sure IE6 doesn&amp;#39;t play pranks on us in production.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52894" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/jCM3NVszGCM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/sergio_pereira/archive/tags/Tips-and-Tricks/default.aspx">Tips-and-Tricks</category><feedburner:origLink>http://devlicio.us/blogs/sergio_pereira/archive/2009/10/21/ie6-still-haunts-me.aspx</feedburner:origLink></item><item><title>Without Context everything is suspect</title><link>http://feedproxy.google.com/~r/Devlicious/~3/DVX0rzVpZZs/without-context-everything-is-suspect.aspx</link><pubDate>Mon, 19 Oct 2009 12:02:52 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52770</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Over the weekend I was having a conversation with my wife and we were not communicating on the same wave length.&amp;#160; After a few minutes of talking in circles it dawned on us that we had not established the context around the conversation and we had no real understanding of what either of us was saying.&amp;#160; This lead to remember a time a few jobs ago when ‘lack of context’ lead people to draw the wrong conclusions about a forth coming client visit.&lt;/p&gt;  &lt;p&gt;The background for this little story goes something like this.&amp;#160; We had an existing client of ours that had an internal development project underway and they wanted us to come onsite to gain a better understanding of this project as well as to see how our product could integrate/play nice with their project.&amp;#160; Prior to meeting with the client (in person or via a phone conversation) we were presented with a power point presentation which laid out the ideas and intent of this project.&amp;#160; Now keep in mind that this power point was not created specify for our viewing, but it was very, very relevant in respect to the projects goals and aspirations.&lt;/p&gt;  &lt;p&gt;As this was the first interaction (from a product development standpoint, not a sales standpoint) with this given client our team had no background or history to draw from when reviewing the slide deck.&amp;#160; As we were reviewing the deck the entire team stopped at the page that was titled ‘Rules of the Game’ and had a few bullet points which said things like ‘Don’t ask dumb questions’ and ‘Don’t make this harder than it has to be’.&amp;#160; Immediately upon reviewing this deck we all go the impression that this meeting was going to be rough and that the client was going to be a little bit on the difficult site.&lt;/p&gt;  &lt;p&gt;Fast forward a few weeks till when we were able to get onsite with the client and have a conversation with them.&amp;#160; During the initial stages of the meeting the client was doing a white board session (which I love when a client does this) about their goals and what they had in mind.&amp;#160; During this session the CIO started to go over the ‘Rules of the Game’ with the group.&amp;#160; However, this time because we had more context to go on our perception and understanding of the rules changed 100% percent.&amp;#160; The context of the conversation was not pointed towards us, the product team.&amp;#160; But rather about how he did not want the application to get in the way of the user by 1) asking dumb questions or 2) making their life harder than it needed to be. &lt;/p&gt;  &lt;p&gt;About 30 seconds after our client was finished with his whiteboard session the team members all kind of looked at each other and all came to the realization that we had misinterpreted the the message based solely on the fact there was not context in the power point deck.&amp;#160; This realization was great, because now we fully understood the client as well as their intent.&amp;#160; It also made us feel a little better because we had gone into the meeting expecting there to be a bit of hostility and in fact the exact opposite was the case.&lt;/p&gt;  &lt;p&gt;The moral of the story is this.&amp;#160; Context is a powerful part of any message.&amp;#160; If you do not clearly communicate the context in a clear and concise manor you are leaving your messages up for interpretation and this can lead to bad things.&amp;#160; The same holds true not only for emails, but also for your code. &lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52770" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/DVX0rzVpZZs" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Development/default.aspx">Development</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Craftsmanship/default.aspx">Craftsmanship</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2009/10/19/without-context-everything-is-suspect.aspx</feedburner:origLink></item><item><title>IncaBlocks Released, Thanks AgileZen and Kanban!</title><link>http://feedproxy.google.com/~r/Devlicious/~3/1MX-qOZegOE/incablocks-released-thanks-agilezen-and-kanban.aspx</link><pubDate>Wed, 14 Oct 2009 15:21:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:52665</guid><dc:creator>Michael C. Neel</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;a href="http://marketplace.xbox.com/en-US/games/media/66acd000-77fe-1000-9115-d8025855032f"&gt;&lt;img style="border-right-width:0px;margin:0px 10px 10px 0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="Box_cover" alt="Box_cover" src="http://www.vinull.com/Assets/Images/windowslivewriterincablocksreleasedfuncworksfirstxnagame_13492box_cover_0380a2b540504cb3b3302bc8609fbada.jpg" width="204" align="left" border="0" height="244" /&gt;&lt;/a&gt;&lt;a href="http://feelthefunc.com"&gt;FuncWorks, LLC&lt;/a&gt;&amp;rsquo;s first XNA game, &lt;a href="http://marketplace.xbox.com/en-US/games/media/66acd000-77fe-1000-9115-d8025855032f"&gt;IncaBlocks&lt;/a&gt;, is now available on Xbox Live Indie Games (XBLIG)!&lt;/p&gt;
&lt;p&gt;This game represents the many hours and weekends &lt;a href="http://dylanwolf.com"&gt;Dylan&lt;/a&gt;, &lt;a href="http://finsandstems.com"&gt;Cicelie&lt;/a&gt; and myself worked the past several months.&amp;nbsp; Looking back at SVN, I started this as a side project to &lt;a href="http://www.youtube.com/watch?v=RhZ03RUj_NE"&gt;ROCS&lt;/a&gt; around July 30th.&amp;nbsp; Shortly thereafter we decided to put ROCS on hold and make IncaBlocks the first game we would release.&amp;nbsp; Keeping with our belief in over delivering, we priced IncaBlocks at 80 Points ($1.00). &lt;/p&gt;
&lt;p&gt;Game play is pretty simple &amp;ndash; stack blocks following some rules, and the one with the most blocks on top at the end wins.&amp;nbsp; I recorded a short video of a game to help everyone check it out (there is also a free trial version on Xbox):&lt;/p&gt;
&lt;p align="center"&gt;
&lt;object width="580" height="360"&gt;
&lt;param name="movie" value="http://www.youtube.com/v/Zg4OAck7rAA&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;border=1" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="allowscriptaccess" value="always" /&gt;&lt;embed src="http://www.youtube.com/v/Zg4OAck7rAA&amp;amp;hl=en&amp;amp;fs=1&amp;amp;rel=0&amp;amp;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="580" height="360"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/p&gt;
&lt;p&gt;IncaBlocks was also the first project that we made heavy use of &lt;a href="http://en.wikipedia.org/wiki/Kanban"&gt;Kanban&lt;/a&gt; and &lt;a href="http://agilezen.com/"&gt;AgileZen&lt;/a&gt;.&amp;nbsp; Kanban is an idea I&amp;rsquo;ve loved in theory for a while, but hadn&amp;rsquo;t had the chance to use it on a real project (meaning a project with a deadline).&amp;nbsp; We used both the online board at AgileZen, and a real board in my office.&amp;nbsp; &lt;a href="http://kohari.org/"&gt;Nate&lt;/a&gt; and &lt;a href="http://nikibeth.com/"&gt;Nicole&lt;/a&gt; have done an awesome job with AgileZen, and in my not-so-humble opinion have a better project management system than &lt;a href="http://basecamphq.com/"&gt;Basecamp&lt;/a&gt;.&amp;nbsp; As with &lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt;, Nate has a knack for stripping away the excess and leaving only the good parts.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;That said, you cannot beat the feeling of a physical Kanban board.&amp;nbsp; Moving a work item physically through the project flow gives one a great sense of accomplishment.&amp;nbsp; We stuck to two basic rules of the board: first, you can only have one task in progress at a time, and second, you must take a task, once started, all the way to done.&amp;nbsp; I think at least 3 times I &amp;ldquo;reset&amp;rdquo; the board and moved tasks around in the ready columns to change priority.&amp;nbsp; This allowed us to keep a high velocity while reacting to change (considering this was our first XNA game to be release, we had many changes as a result of just learning XNA and XBLIG worked).&amp;nbsp; While we pruned the done items from AgileZen, we left them all up on the wall:&lt;/p&gt;
&lt;p align="center"&gt;&lt;a href="http://www.vinull.com/Assets/Images/windowslivewriterincablocksreleasedfuncworksfirstxnagame_13492dscf6419.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="Don&amp;#39;t you have a Fender Stat in your office too?" alt="Don&amp;#39;t you have a Fender Stat in your office too?" src="http://www.vinull.com/Assets/Images/windowslivewriterincablocksreleasedfuncworksfirstxnagame_13492dscf6419_thumb.jpg" width="644" border="0" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We already have ideas for our next games, though I will have to take a break from game development while I work on an ebook for &lt;a href="http://www.wrox.com"&gt;Wrox&lt;/a&gt;.&amp;nbsp; The working title is &amp;ldquo;XNA 3D Primer&amp;rdquo;, and will be a crash course in 3D game programming.&amp;nbsp; I also plan to do some post mortem posts on IncaBlocks and the lessons we learned along the way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=52665" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/1MX-qOZegOE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/vinull/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/vinull/archive/tags/agile/default.aspx">agile</category><category domain="http://devlicio.us/blogs/vinull/archive/tags/xna/default.aspx">xna</category><category domain="http://devlicio.us/blogs/vinull/archive/tags/kanban/default.aspx">kanban</category><feedburner:origLink>http://devlicio.us/blogs/vinull/archive/2009/10/14/incablocks-released-thanks-agilezen-and-kanban.aspx</feedburner:origLink></item></channel></rss>
