<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Anders Norås' blog</title><link>http://www.dotnetjunkies.com/WebLog/anoras/default.aspx</link><description>The service orient express</description><dc:language>en-US</dc:language><generator>CommunityServer 1.0 (Build: 1.0.1.50214)</generator><item><title>Blog moved...</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2007/02/13/195376.aspx</link><pubDate>Tue, 13 Feb 2007 10:01:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:195376</guid><dc:creator>anoras</dc:creator><slash:comments>1586</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/195376.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=195376</wfw:commentRss><description>This post is a reminder that this blog has moved to &lt;A href="http://andersnoras.com/blogs/anoras"&gt;&lt;FONT&gt;http://andersnoras.com/&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Please updated your subscriptions: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSS 2.0: &lt;A href="http://andersnoras.com/blogs/anoras/rss.aspx"&gt;&lt;FONT&gt;http://andersnoras.com/blogs/anoras/rss.aspx&lt;/FONT&gt;&lt;/A&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ATOM 1.0: &lt;A href="http://andersnoras.com/blogs/anoras/atom.aspx"&gt;&lt;FONT&gt;http://andersnoras.com/blogs/anoras/atom.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=195376" width="1" height="1"&gt;</description></item><item><title>Blog moved...</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2007/02/06/192285.aspx</link><pubDate>Tue, 06 Feb 2007 20:25:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:192285</guid><dc:creator>anoras</dc:creator><slash:comments>1500</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/192285.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=192285</wfw:commentRss><description>This post is a reminder that this blog has moved to &lt;a href="http://andersnoras.com/blogs/anoras"&gt;http://andersnoras.com/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Please updated your subscriptions:
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; RSS 2.0: &lt;a href="http://andersnoras.com/blogs/anoras/rss.aspx"&gt;http://andersnoras.com/blogs/anoras/rss.aspx&lt;/a&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ATOM 1.0: &lt;a href="http://andersnoras.com/blogs/anoras/atom.aspx"&gt;http://andersnoras.com/blogs/anoras/atom.aspx&lt;/a&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=192285" width="1" height="1"&gt;</description></item><item><title>HTTP 301: Blog moved!</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2007/01/30/190554.aspx</link><pubDate>Tue, 30 Jan 2007 23:11:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:190554</guid><dc:creator>anoras</dc:creator><slash:comments>567</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/190554.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=190554</wfw:commentRss><description>Hello faithful reader! &lt;br&gt;&lt;br&gt;This blog has moved to &lt;a href="http://andersnoras.com/blogs/anoras"&gt;http://andersnoras.com/blogs/anoras&lt;/a&gt;

&lt;br&gt;&lt;br&gt;Please updated your subscriptions:
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSS 2.0: &lt;a href="http://andersnoras.com/blogs/anoras/rss.aspx"&gt;http://andersnoras.com/blogs/anoras/rss.aspx&lt;/a&gt;
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ATOM 1.0: &lt;a href="http://andersnoras.com/blogs/anoras/atom.aspx"&gt;http://andersnoras.com/blogs/anoras/atom.aspx&lt;/a&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=190554" width="1" height="1"&gt;</description></item><item><title>I'm back!</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/09/15/147203.aspx</link><pubDate>Fri, 15 Sep 2006 15:58:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:147203</guid><dc:creator>anoras</dc:creator><slash:comments>6354</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/147203.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=147203</wfw:commentRss><description>&lt;P&gt;I've just returned from the JavaZone 2006 where I gave a talk entitled "Our Stuff, Your Way - Developing Microsoft .NET Applications with 'Java' Frameworks", and reckoned that this would be a good occasion to get back into blogging. I've had a super busy few months, so this conference was one of the few chances I've had to go out and meet industry coleagues in a while. Judging by the number of sessions I actually found time to see, I suspect it was by time I went to an event like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On Tuesday I went to the speakers dinner party were I got to meet a few living legends such as Mary Poppendieck, Rod Johson and Gregor Hophe to name a few. The latter also put on a "Drinks are on Google" party at the sky bar of the hotel later that night. I had one or two drinks too many on Google, so I should really go click some ad-words to pay them back. &lt;BR&gt;Wendsay mornig I did my talk on developing .NET applications "the Java way". I was a bit disappointend by the attendance, but the people who were there seemed to enjoy it. (&lt;A href="http://blogs.ittoolbox.com/bi/confessions/archives/JavaZone-06-Day-1-11659"&gt;http://blogs.ittoolbox.com/bi/confessions/archives/JavaZone-06-Day-1-11659&lt;/A&gt;). My talk was a quick run through of how Java developers could just their knowledge of popular frameworks like Spring and Hibernate, to develop .NET-apps with the ports of these frameworks. To close the circle, I rounded it off by showing off how one could apply some voodoo magic to program directly against log4j, or any other Java library, from within a regular .NET application. This was without doubt the most popular demo in my presentation, and also the demo that spawned the most questions.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;You should find the slides from my talk here: &lt;A href="http://217.199.33.59/jz/2006/slides/4513.pdf"&gt;http://217.199.33.59/jz/2006/slides/4513.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The session was both recorded as a podcast and video with intention to publish after the conference so stay tuned to links to those as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After lunch, I met up with Bruce Tate, the author of the "Bitter Java" and "Beyond Java" books, to sit down an do a back-to-back comparision of C# 3.0 and Ruby. As allways, LINQ is impressive, but C#'s extension methods aren't nearly as cool as some of the stuff you can do with Ruby mixins. I'll try to write a proper post on this some time soon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I rushed off to do a panel discussion on SOA immediatly after my meeting with Bruce. The panel was a meet the experts forum, where the conference attendatnts were taking part in the discussion. Apart from myself, people like Interface21's Arjen Poutsma (&lt;A href="http://blog.springframework.com/arjen/"&gt;http://blog.springframework.com/arjen/&lt;/A&gt;) who is the dev lead of the Spring Web Serivce framework, Mads Nissen and IBMs Gobal Sales Manager for their WebSphere suite, amongst others. We made no real, hard conclusions, but there seemd to be a consenus that a service's data was more important than its operations and that contracts should be spilt in operational and data contracts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wedensday night was party-night. Being tired from the night before, I kept my cool and went home after having a beer with Kevlin Henny and chatting about lean methods, kids and moving house.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thursday I had a long meeting with Microsoft's Jürgen Pfeifer mostly about my current project which I can't tell you much about due to a NDA, but it's a large service oriented application for an insurance company. Naturally our talk was around SOA-stuff like orchestration and governance.&lt;/P&gt;
&lt;P&gt;Later I gave a more detailed version of my "using JAR's from C#" demo to Alexandru Popescu (&lt;A href="http://themindstorms.blogspot.com/"&gt;http://themindstorms.blogspot.com/&lt;/A&gt;), extending it to also using .NET assemblies from a Java application. It was the first time he'd seen a thing like that done, and I was real cool to help him out with a problem he'd been think about for some time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;During the entire conference I only saw one presentation, which was&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Erik Doernenburg (&lt;A href="http://erik.doernenburg.com/"&gt;http://erik.doernenburg.com/&lt;/A&gt;) and Gregor Hohpe's (&lt;A href="http://www.enterpriseintegrationpatterns.com/ramblings.html"&gt;http://www.enterpriseintegrationpatterns.com/ramblings.html&lt;/A&gt;) talk on software visualization. The rest of the time I just hung around, talking to people. This is one of the cool things about the JavaZone conference, the atmosphere is really laid-back and allmost every session is either web or podcasted, so you can catch them after the conference. This year it was all networking and having a fun time for me.&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=147203" width="1" height="1"&gt;</description></item><item><title>IKeyComparer?</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/03/19/136069.aspx</link><pubDate>Sun, 19 Mar 2006 21:05:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:136069</guid><dc:creator>anoras</dc:creator><slash:comments>2178</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/136069.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=136069</wfw:commentRss><description>&lt;P&gt;&lt;SPAN&gt;The preperation guide for &lt;A href="http://www.microsoft.com/learning/exams/70-536.asp"&gt;70-536 &lt;SPAN&gt;Microsoft .NET Framework 2.0 - Application Development Foundation&lt;/SPAN&gt;&lt;/A&gt; points to the &lt;SPAN&gt;IKeyComparer &lt;/SPAN&gt;and the &lt;SPAN&gt;IHashCodeProvider &lt;/SPAN&gt;interfaces as fundamentals you should be proficient with before taking the test. There is no such thing as an IKeyComparer interface in the .NET Framework 2.0 -&amp;nbsp;the interface was removed after beta 1. The &lt;SPAN&gt;IHashCodeProvider &lt;/SPAN&gt;interface has been marked obsolete in .NET 2.0 and you should use the IEqualityComparer interface instead.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The beta 1 design of the &lt;SPAN&gt;IComparer&lt;/SPAN&gt; interface grouped all comparison related methods into a single interface to avoid a common design fault from .NET 1.1, where one could pass an incompatible pair of &lt;SPAN&gt;IComparer &lt;/SPAN&gt;and &lt;SPAN&gt;IHashCodeProvider &lt;/SPAN&gt;to the &lt;SPAN&gt;Hashtable &lt;/SPAN&gt;constructor. After shipping beta 1 of .NET 2.0, Microsoft split their original &lt;SPAN&gt;IComparer &lt;/SPAN&gt;interface into the &lt;SPAN&gt;IEqualityComparer &lt;/SPAN&gt;and a new definition of &lt;SPAN&gt;IComparer&lt;/SPAN&gt; after realizing that the new design introduced incompatabilies with classes that currently didn’t implent &lt;SPAN&gt;IComparable&lt;/SPAN&gt; and that the &lt;SPAN&gt;IComparable.CompareTo(T)&lt;/SPAN&gt; method required types to have natural ordering.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The &lt;SPAN&gt;IKeyComparer &lt;/SPAN&gt;was in essence both an &lt;SPAN&gt;IHashCodeProvider &lt;/SPAN&gt;and an &lt;SPAN&gt;IComparer &lt;/SPAN&gt;that was intended to be used to compare dictionary keys based on hashcode equality, thus avoiding the .NET 1.1 scenario where one could pass an &lt;SPAN&gt;IHashCodeProvider &lt;/SPAN&gt;that considered two instances equal along with an &lt;SPAN&gt;IComparer &lt;/SPAN&gt;that considered the same instances as inequal making the &lt;SPAN&gt;Hashtable &lt;/SPAN&gt;indexer fail to find a value with a given key.&lt;o:p&gt;&lt;/o:p&gt;&lt;BR&gt;You might also have heard of an interface called &lt;SPAN&gt;IHashComparer&lt;/SPAN&gt;. This was a proposed name for the &lt;SPAN&gt;IKeyComparer &lt;/SPAN&gt;interface during the beta 2 refactoring, but this interface was not included in the final release of .NET 2.0.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The one interface you should know is &lt;SPAN&gt;IEqualityComparer&lt;/SPAN&gt;. This is a special interface that should only be used for determining equality, and not for sorting. The interface is particularly handy for culture aware comparisons such as determing that the German words &lt;SPAN&gt;”weiss”&lt;/SPAN&gt; and &lt;SPAN&gt;”weiß” &lt;/SPAN&gt;are the same.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=136069" width="1" height="1"&gt;</description></item><item><title>How To: Strongname Inheritance Demands at Runtime</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/03/02/135700.aspx</link><pubDate>Thu, 02 Mar 2006 13:18:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:135700</guid><dc:creator>anoras</dc:creator><slash:comments>837</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/135700.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=135700</wfw:commentRss><description>&lt;p&gt;Yesterday a client of mine had an interesting challenge. He had a
sealed class which he needed to “unseal” due to some changes in his
project. However he needed to control who could inherit the class and
applied a &lt;font face="Courier New"&gt;StrongNameIdentityPermissionAttribute&lt;/font&gt; with an &lt;font face="Courier New"&gt;InheritanceDemand&lt;/font&gt;
action to the class. He soon learned that the XmlSerializer cannot
serialize types with declarative security. This is by design in the
.NET framework, since XML serialization is achieved through runtime
generated types for performance reasons. A common workaround is to
apply imperative security in lieu of declarative security. However,
since &lt;font face="Courier New"&gt;InheritanceDemand&lt;/font&gt; is a load time security assertion, this was not a feasible option for my client.&lt;br&gt;The solution to the challenge was to recreate the inheritance demand action in the class’ constructor as shown below. &lt;br&gt;&lt;font face="Courier New"&gt;&lt;font&gt;public abstract class&lt;/font&gt; InheritanceDemandingClass&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font&gt;protected&lt;/font&gt; InheritanceDemandingClass()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;byte&lt;/font&gt;[] myPK = &lt;font color="#0000ff"&gt;typeof&lt;/font&gt;(InheritanceDemandingClass).Assembly.GetName().GetPublicKey();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;byte&lt;/font&gt;[] callingPK = Assembly.GetCallingAssembly().GetName().GetPublicKey ();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;if&lt;/font&gt; (callingPK==null || myPK.Length!=callingPK.Length)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;throw new&lt;/font&gt; SecurityException("The calling assembly does not have permission to create this type.");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;for&lt;/font&gt; (&lt;font color="#0000ff"&gt;int&lt;/font&gt; i = 0; i &amp;lt; myPK.Length; i++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;if&lt;/font&gt; (myPK[i]!=callingPK[i])&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;throw new&lt;/font&gt;
SecurityException("The calling assembly does not have permission to
create this
type.");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The above code compares the calling assembly’s public key with the class’ public key and throws a &lt;font face="Courier New"&gt;SecurityException&lt;/font&gt;
if the two assemblies aren’t signed with the same key. This simple
solution should be sufficient for most scenarios, as the common usage
for inheritance demands is to ensure that only your types can extend
your types. However the example can easily be extended to support other
keys or public key tokens as well.&lt;br&gt;There are some differences with
this approach and using declarative security; the type can be reflected
since the security assertion happens at runtime, and you cannot use
permview.exe to see what demands the type makes. If imperative security
was applied you would still have both of these issues.&lt;br&gt;&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=135700" width="1" height="1"&gt;</description></item><item><title>Heisenbugs and Conditional Breakpoints</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/03/01/135668.aspx</link><pubDate>Wed, 01 Mar 2006 17:58:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:135668</guid><dc:creator>anoras</dc:creator><slash:comments>2392</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/135668.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=135668</wfw:commentRss><description>&lt;P&gt;Have you ever heard the term &lt;EM&gt;Heisenbug&lt;/EM&gt;? If not, it is adopted from Heisenberg’s Uncertainty Principle in quantum physics. An Heisenbug is a bug that disappears or alters its behavior when one tries to observe it. In physics the principle states that on cannot assign the precise values of observable variables of a single particle even in theory. In software engineering a Heisenbug might be introduced by some force applied when debugging an application. Some Heisenbugs appear in the code, for instance within an if statement relying on &lt;FONT face="Courier New"&gt;System.Diagnostics.Debugger.IsAttached&lt;/FONT&gt;. With such a bug, the debugger will step into the infected code and you’re likely to spot the problem straight away. However, debuggers have more esoteric ways of introducing Heisenbugs that aren’t easily spotted. One particularly nasty Heisenbug I’ve seen a couple of times is introduced by conditional breakpoints. If you’re a C# developer and you forget that the equality operator in C# is “==” and not “=” you’re prone to Heisenbugs. Consider the following snippet:&lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;FONT&gt;&amp;nbsp;31&lt;/FONT&gt; IContext context=&lt;FONT&gt;new&lt;/FONT&gt; Context();&lt;BR&gt;&lt;FONT&gt;&amp;nbsp;32&lt;/FONT&gt; context.Request request = &lt;FONT&gt;new&lt;/FONT&gt; Request();&lt;BR&gt;&lt;FONT&gt;&amp;nbsp;33&lt;/FONT&gt; context.Request.Payload = ExtractMessageBody(soapServerMessage);&lt;BR&gt;&lt;FONT&gt;&amp;nbsp;34&lt;/FONT&gt; Uri actionUri = &lt;FONT&gt;new&lt;/FONT&gt; Uri(soapServerMessage.Action);&lt;BR&gt;&lt;FONT&gt;&amp;nbsp;35&lt;/FONT&gt; &lt;FONT&gt;string&lt;/FONT&gt; serviceName = actionUri.Segments[actionUri.Segments.Length - 1];&lt;BR&gt;&lt;FONT&gt;&amp;nbsp;36&lt;/FONT&gt; request.ServiceName = serviceName;&lt;BR&gt;&lt;FONT&gt;&amp;nbsp;37&lt;/FONT&gt; PipelineController.Execute(context);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Let’s imagine that the implementation of the &lt;FONT face="Courier New"&gt;PipelineController.Execute&lt;/FONT&gt; method is complex and uses a myriad of other classes to perform the desired operation. During testing you discover that when a certain service is requested the class does not behave as expected. To save yourself from endless F11 tapping, you set a conditional breakpoint at line 35 with the condition: &lt;FONT face="Courier New"&gt;serviceName=”BillingService”&lt;/FONT&gt;&lt;BR&gt;When you try to figure out what is going on, all sorts of weird things start to happen. Requests for the “BillingService” receive messages used with the “OrderService” and the application seems to be horribly broken.&lt;BR&gt;Unexplainable behavior like this is often an Heisenbug. In the scenario described above the conditional breakpoint assigns the value “BillingService” to then &lt;FONT face="Courier New"&gt;serviceName&lt;/FONT&gt; variable whenever the execution pointer passes, hence the value of &lt;FONT face="Courier New"&gt;request.ServiceName&lt;/FONT&gt; will always be “BillingService”.&amp;nbsp; Since they’re not apparent in code, Heisenbugs like this are devious and though to spot, so be sure to pay as much attention to your break conditions as your “real” code, even during the most intense debugging sessions or else conditional breakpoints soon become a timewaster rather than a timesaver.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=135668" width="1" height="1"&gt;</description></item><item><title>Connected Systems: A &amp;quot;Real-life&amp;quot; Example</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/01/19/134810.aspx</link><pubDate>Thu, 19 Jan 2006 20:44:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134810</guid><dc:creator>anoras</dc:creator><slash:comments>3488</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134810.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134810</wfw:commentRss><description>The CTO at &lt;a href="http://www.objectware.no"&gt;the company I work for&lt;/a&gt; sent me &lt;a href="http://blueballfixed.ytmnd.com/"&gt;this link&lt;/a&gt; today. It is a perfect example of a Connected System. The "system" employs many of the common patterns used to build a connected system, such as pipes and filters, queues and stacks, routing , content enrichers and compression and many many more. Enjoy!&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134810" width="1" height="1"&gt;</description></item><item><title>Visual Basic 2005 Does Not Support Friend Assemblies</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/01/10/134684.aspx</link><pubDate>Tue, 10 Jan 2006 20:57:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134684</guid><dc:creator>anoras</dc:creator><slash:comments>699</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134684.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134684</wfw:commentRss><description>&lt;p class="MsoNormal"&gt;I’ve gotten some feedback from Visual Basic .NET developers having
trouble following my “How To” on &lt;a href="../../anoras/archive/2006/01/08/134628.aspx"&gt;code
coverage and IL Merge&lt;/a&gt;. I turns out that the Visual Basic .NET 2005 compiler
doesn’t support the &lt;span&gt;InternalsVisibleTo &lt;/span&gt;attribute. After adding the attribute to
an assembly, you won’t get any IntelliSense for the internal, or fiend in
Visual Basic lingo, members. When you try to build the solution the compiler
will raise a BC30390 compilation error akin to &lt;span&gt;'MyClass.Private Function MyMethod(x
As Integer, y As Integer) As Integer' is not accessible in this context because
it is 'Private'&lt;/span&gt;. Unfortunately, there is no workaround for this, so Visual
Basic developers either have to spilt their projects into a handcrafted code project
and a generated code project, and live with the housekeeping implications of
having twice as many assemblies to deploy, or live with skewed code coverage
results.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134684" width="1" height="1"&gt;</description></item><item><title>How To: Exclude Generated Code From Code Coverage Analysis</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2006/01/08/134628.aspx</link><pubDate>Sun, 08 Jan 2006 21:38:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134628</guid><dc:creator>anoras</dc:creator><slash:comments>1913</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134628.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134628</wfw:commentRss><description>&lt;p&gt;To ensure that your unit tests exercise your code properly, you&amp;#8217;ll need sufficient code coverage. Your coverage should be as close as possible to 100 percent. However, if your code base includes generated artifacts, such as resource accessors or strongly typed datasets, it is unlikely that you&amp;#8217;ll come close to this figure. This is because the generated code has methods and properties for a wide variety of usages, many more than you&amp;#8217;re actually using, thus leaving lots of untested code in your project. Since generated code skews your code coverage results, factoring generated code to separate assemblies is a common practice to avoid misleading code coverage metrics. A basic example is to have datasets in one project and business components in another project with a reference to the dataset project. This solves the code coverage issue, but it also introduces some other issues. Since one logical assembly has to be split into two or more physical assemblies, you&amp;#8217;ll lose cohesion between the different logical assemblies. This might not be an issue during development, but you&amp;#8217;ll at least have twice as many assemblies to deploy, version and maintain when the solution goes to production. Michael Barnett of Microsoft Research has developed a tool called &lt;a href="http://research.microsoft.com/~mbarnett/ILMerge.aspx"&gt;IL Merge&lt;/a&gt; which can be used to merge multiple .NET assemblies into a single assembly. If you&amp;#8217;re familiar with C-programming, IL Merge is akin to a linker.&lt;/p&gt; 
    &lt;p&gt;For the remainder of this post I&amp;#8217;ll show how you can factor a resource accessor out of a business component project to its own project, make the internals of that project available to the business component project (resource accessors aren&amp;#8217;t publicly visible) and use IL Merge to merge the two assemblies into one.&lt;/p&gt; 
    &lt;p&gt;I have created a small Visual Studio 2005 solution with two projects, one for business components and another for resources.&lt;/p&gt; 
    &lt;p&gt;&lt;img src="/WebLog/photos/anoras/images/134624/original.aspx"&gt;&lt;/p&gt; 
    &lt;p&gt;As mentioned earlier the generated resource accessor class is an internal class, and hence it is not available outside the assembly itself. There are numerous ways you can access the internals of one assembly from another. The most elegant is to use the .NET 2.0 InternalsVisibleTo attribute. This attribute allows you to declaratively give one or more assemblies access to the assembly&amp;#8217;s internal members. The following declaration has been added to the ClassLibrary.Resources project&amp;#8217;s AssemblyInfo.cs file. &lt;code&gt;[assembly:InternalsVisibleTo(&amp;quot;ClassLibrary&amp;quot;)]&lt;/code&gt;&lt;/p&gt;
    &lt;p&gt;For a thorough discussion on InternalsVisibleTo and the other options available for accessing one assembly&amp;#8217;s internal members from another, see my post &lt;a href="http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/06/17/125477.aspx"&gt;&amp;#8220;InternalsVisibleTo, StrongNameIdentityPermission and reflection&amp;#8221;&lt;/a&gt;.&lt;/p&gt; 
    &lt;p&gt;The internals of ClassLibrary.Resources are now available from within the ClassLibrary project with IntelliSense and other Visual Studio comforts just like if both the resources and the code had been part of the same project. An important difference is that the code base is spilt into two assemblies, so that you&amp;#8217;re able to instrument just the ClassLibrary assembly and get accurate code coverage results.&lt;/p&gt; 
    &lt;p&gt;When the unit test have been run (with code coverage instrumentation) you can then merge the two into a single assembly by using the IL Merge tool. &lt;/p&gt; 
    &lt;p&gt;&lt;img src="/WebLog/photos/anoras/images/134626/500x26.aspx"&gt;&lt;/p&gt; 
    &lt;p&gt;As you would expect, the merged assembly contains both the business component from the ClassLibrary project and the resources from the ClassLibrary.Resources project. Also note that it is a regular .NET assembly, so you can add it as a reference to any other project, sign it with your strong name key or similar.&lt;/p&gt; 
    &lt;p&gt;Typically you would merge the two assemblies either when you package a release version of your code or from within your continuous integration build script prior to deploying it to a test rig.&lt;/p&gt; 
    &lt;p&gt;There is a NAnt task for IL Merge available for download &lt;a href="http://blogs.labo-dotnet.com/colophon/archive/2004/07/20/3403.aspx"&gt;here&lt;/a&gt;. I&amp;#8217;m not aware of a MSBuild task for IL Merge, but you can easily run IL Merge from your MSBuild script using the &lt;code&gt;Exec&lt;/code&gt; task as shown below&lt;/p&gt;&lt;code&gt;&lt;pre&gt;
    &amp;lt;Project DefaultTargets=&amp;quot;CompileUserControls&amp;quot;
     xmlns=&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&amp;gt;
     ...
     &amp;lt;Target Name=&amp;quot;MergeAssemblies&amp;quot;&amp;gt;
     &amp;lt;Exec Command=&amp;quot;$(ILMergeEXE) /out:$MergedClassLibrary.dll
     ClassLibrary.dll ClassLibrary.Resources.dll&amp;quot; /&amp;gt;
     &amp;lt;/Target&amp;gt;
     ...
    &amp;lt;/Project&amp;gt;&lt;/pre&gt;&lt;/code&gt;
    &lt;p&gt;I believe this is an elegant solution to a problem which almost everyone doing Test Driven Development on the .NET platform run into. However, one feature I&amp;#8217;d really like to see in Visual Studio Orcas is the ability to declaratively exclude types, or even members from code coverage instrumentation. This could very well follow the same convention used to suppress static analysis rules with &lt;code&gt;System.Diagnostics.CodeAnalysis.SuppressMessageAttribute&lt;/code&gt; since this would allow any vendor to support it without forcing developers to reference a particular assembly in their code (SupressMessageAttribute is defined in mscorlib.dll). The solution described in this post is vendor neutral and works just as good with Team Test as with Clover.NET or any other code coverage analyzer.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134628" width="1" height="1"&gt;</description></item><item><title>Off topic: Best Albums of 2005</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/12/16/134361.aspx</link><pubDate>Fri, 16 Dec 2005 23:27:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134361</guid><dc:creator>anoras</dc:creator><slash:comments>29</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134361.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134361</wfw:commentRss><description>&lt;ol&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000777J2S/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0VBS4EFNMW9QEVV92Y48&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000777J2S.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Anthony and The Johnsons – I am a Bird Now&lt;/a&gt; &lt;/b&gt;&lt;br&gt;
I
am a Bird now was released back in January, and it has been on heavy
rotation on my iPod ever since. Anthony has a voice like the late,
great Nina Simone who had a deep, masculine voice. This is a striking
coincidence on songs such as “For Today I am a Boy” which is about the
travails of transgender confusion with its heartbreaking line “One day
I’ll grow up to be a beautiful woman, but for now I am a boy”. Musical
highlights: My Lady Story, Hope There’s Someone&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0002IVN9W/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=09GH6FW8YA2C2FDN5MWE&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B0002IVN9W.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Arcade Fire – Funeral&lt;/a&gt; &lt;br&gt;
&lt;/b&gt;Funeral
is a stunningly brilliant album, filled to the rim with emotional
intensity. The Arcade Fire blends the sounds from great bands from the
1980s post-punk scene, The Pixies and Roxy Music to name a few, to
create their own, new and refreshing soundscape. The album was released
in Canada in 2004, but it didn’t get a proper European release until
this year. Musical highlights: Neighborhood #1 - #4. &lt;br&gt;&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B5QWNI/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0Z6B5CPH0G982C1SM1P4&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000B5QWNI.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;My Morning Jacket - Z&lt;/a&gt; &lt;br&gt;
&lt;/b&gt;After
two releases that didn’t really appeal to me, My Morning Jacket rises
like a phoenix with Z with an entirely new sound. The music is
spontaneous and doesn’t seem to follow any conventional musical
patterns. A pleasant surprise. Musical highlights: Wordless Chorus,
Anytime &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000BHNLX0/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1F84CQM6XH6YJHPMWA78&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000BHNLX0.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Kate Bush – Aerial&lt;/a&gt; &lt;/b&gt;&lt;br&gt;
Kate
Bush has always gone her own way, and her “comeback” this year is no
exception. The double album is musically expansive, where everything
from birdsong to eighties inspired synths and jazz elements blend into
a lush musical journey. The lyrics are eerie, deeply personal and they
grab you right from the beginning. Musical highlights: A Sky of Honey
(The suite which makes up CD 2). &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000AJJNPY/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=062T3HMXKN0PYHF3WN4Y&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000AJJNPY.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Sigur Rós – Takk&lt;/a&gt; &lt;br&gt;
&lt;/b&gt;Takk
is an album with quite, yet still noisy music that is pure bliss. I
can’t understand a word they’re singing since the lyrics are in either
Icelandic or in the fabricated Hopelandish language, but this makes the
album even more wonderful as the beautiful vocals come across as
musical instruments. Musical highlight: Hoppipolla, Glósóli &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B66PP2/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0SZ1M51B5GB1WM8VESMD&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000B66PP2.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;The Magic Numbers – The Magic Numbers&lt;/a&gt; &lt;/b&gt;&lt;br&gt;
The
Magic Numbers is the most perfect pop record of the year with great
lyrics, incredible hooks and great SoCal style harmonies. Musical
highlights: Forever Lost, Love Me Like You, Love Is a Game &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000BLI38O/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1KNSPAJ5CAVF5Q4197M4&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000BLI38O.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Bell Orchestre – Recording a Tape The Colour of Light&lt;/a&gt; &lt;/b&gt;&lt;br&gt;
Bell
Orchestre is a spin-off from many bands in the Montréal scene, with
members from bands like Arcade Fire. Their music can best be describes
as a mash of chamber music and post punk. The album isn’t easily
accessible, but once you get your ears around it you’re sold. Musical
highlights: Les Lumineres pt. 1 &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000A9QKCS/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0V1DJ3DESXT5D2FH31EF&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000A9QKCS.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Little Brother – The Minstrel Show&lt;/a&gt; &lt;br&gt;
&lt;/b&gt;While
you’ll probably have to browse the hip-hop section of your local record
store to find this album, this album is the opposite of your regular
rap album. The Minstrel Show is a concept album centered on a
television show which acts as a metaphor for everything that is wrong
with today’s mainstream hip hop. Musical highlights: The experience as
a whole, which is rare with hip hop albums these days. &lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009R1T7M/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0GZ19S8GGYYCM12SHQ4E&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B0009R1T7M.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Sufjan Stevens – Illinoise&lt;/a&gt; &lt;br&gt;
&lt;/b&gt;Illinoise
is a sprawling musical celebration, which encompasses a vast set of
musical styles, blended into magical, sophisticated arrangements. This
is a great album. Musical highlights: Come Feel The Illinoise &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;b&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B9EYDY/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=11PDYMZTE1E0F93GZ37M&amp;amp;link_code=as1"&gt;&lt;img src="http://rcm-images.amazon.com/images/P/B000B9EYDY.01._SCTZZZZZZZ_.jpg" align="left" border="0"&gt;Dangerdoom – The Mouse and The Mask&lt;/a&gt; &lt;/b&gt;&lt;br&gt;
The
collaboration between MF Doom and production genius Danger Mouse has
resulted in a playful album that is heavy on novel details in both
rhyme and rhythm. Musical highlights: Sofa King, Aqua Teen Hunger Force
&lt;br&gt;&lt;br&gt;&lt;br&gt;
    &lt;br&gt;
&lt;br&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000AADYRQ/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0N6KAQNN6Y017ER7BKCS&amp;amp;link_code=as1"&gt;Death Cab for Cutie – Plans&lt;/a&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000A78Z82/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=033EAZXH0NW40SBHJN52&amp;amp;link_code=as1"&gt;Devendra Banhart – Cripple Crow&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009AJK5M/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0G3Y04E3481ZCHG65ZFF&amp;amp;link_code=as1"&gt;Fat Freddie’s Drop – Based on a True Story&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009HL7JM/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0N91EXR1HX2Q6RJ7EKPW&amp;amp;link_code=as1"&gt;Brian Eno – Another Day on Earth&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00080EU44/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1MD2ZQQEA8549MKWRP79&amp;amp;link_code=as1"&gt;Jaga Jazzist – What We Must&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000AMJD8I/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=01Q34P3T3QATVAZJQ2WG&amp;amp;link_code=as1"&gt;Iron &amp;amp; Wine and Calexico – In the Reins (EP)&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0002X314C/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0AE2G7EE9J3CYME2476Y&amp;amp;link_code=as1"&gt;John Legend – Get Lifted&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;Kari Bremnes – Over en by&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009S2TFC/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0979QVRCKAYW0S2C6EY0&amp;amp;link_code=as1"&gt;M.i.A. - Arular&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009I46A8/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=01MW8BHP3B0HV7GSVY5P&amp;amp;link_code=as1"&gt;Jamie Lidell – Multiply&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0007XB5TK/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1WNS854YQJESNZ1NDFNP&amp;amp;link_code=as1"&gt;Roots Manuva – Awfully Deep&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0006FMKDY/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=16WNPTDPGMZFHA4EZBCV&amp;amp;link_code=as1"&gt;Archer Prewitt – Wilderness&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00070DLAO/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=06P0C7X2W0BP5TGD8XCT&amp;amp;link_code=as1"&gt;Iron &amp;amp; Wine – Woman King (EP)&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0007OP66W/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1024WKNJEZYCM2KDAGWR&amp;amp;link_code=as1"&gt;Moneybrother – To Die Alone&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009K7RL6/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=12NE39XQK2DPQMNT5NEB&amp;amp;link_code=as1"&gt;Amadou et Mariam – Dimance à Bamako&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B8TOPS/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0KBN35XN4B9RY9ZY8YPD&amp;amp;link_code=as1"&gt;Steve Reid Ensemble – Sprits Walk&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009IFEJ0/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0DEN4HM5RQ3KZ37TGA4Y&amp;amp;link_code=as1"&gt;Common – Be&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B5XSAI/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0MX7QV6XRNKYD8DCJFC4&amp;amp;link_code=as1"&gt;Porn Sword Tobacco – Explains Freedom&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00075TZYA/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0QYTT3ND901JKZS5QCX7&amp;amp;link_code=as1"&gt;…and You Will Know Us By The Trail of Dead – Worlds Apart&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://rcm-images.amazon.com/images/P/B0007YMUHK.01._SCTZZZZZZZ_.jpg"&gt;Emiliana Torrini – Fisherman’s Woman&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0007KLLC4/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1A3441TYY6DAWSG9G4Z1&amp;amp;link_code=as1"&gt;Edan – Beauty and The Beat&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000777J9G/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=00FPDMTZDJA1E6YM2AX8&amp;amp;link_code=as1"&gt;Low – The Great Destoyer&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009EST0U/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0HJG5X19CTWHTZ48KWDK&amp;amp;link_code=as1"&gt;The Herbaliser – Take London&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0002VEPZS/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0E7MH6S6C8ZBVV8514WC&amp;amp;link_code=as1"&gt;VHS or Beta – Night on Fire&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00070Q7VY/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0P1X9Q5RWTFEGCT9G867&amp;amp;link_code=as1"&gt;Andrew Bird – And The Mysterious Production of Eggs&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000AP2ZQC/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0XBP7RBZ9B3DX40AVRQX&amp;amp;link_code=as1"&gt;Boards of Canada – Campfire Headphase&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0006M4SO6/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1ZPX8HJEF7SZM9T4684E&amp;amp;link_code=as1"&gt;Pat Metheny – The Way Up&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0007YJGFE/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=17FBCMS902QMT3GWG1Y2&amp;amp;link_code=as1"&gt;Quasimoto – The Further Adventures of Lord Quas&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000AOJHZA/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1MW27D3H2PY88JCPTKZJ&amp;amp;link_code=as1"&gt;Clap Your Hands and Say Yeah! – Clap Your Hands and Say Yeah!&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000BDJ02U/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0S1CZW38FV2E5717DY7Q&amp;amp;link_code=as1"&gt;The Fiery Furnaces – Rehearsing My Choir&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00081U6VO/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1FS0SJWCK0NTWPPFJ2DG&amp;amp;link_code=as1"&gt;Harold Budd &amp;amp; Eraldo Bernocchi – Fragments Form The Inside&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000AANW46/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0JF8HMFTSK292R0B2RQ0&amp;amp;link_code=as1"&gt;The Dandy Warhols – Oddatorium or Warlords of Mars&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0006OR12U/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=118CJQBRBKZRYZAADQX2&amp;amp;link_code=as1"&gt;Harmonic 33 – Music for Film, Television and Radio vol. 1&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000A3OX1O/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=0T9FRN77JVDQ5E6PC6Z6&amp;amp;link_code=as1"&gt;Broadcast – Tender Buttons&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B2YQX4/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1NDZTYVRQHM9G5YEA57F&amp;amp;link_code=as1"&gt;Depeche Mode – Playing the Angle&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00070Q8HC/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1STQ40M6N0EE0J9YNXNJ&amp;amp;link_code=as1"&gt;M83 – Before the Dawn Heals Us&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B000B6D6TU/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1ZHNGM2W76VENNSS78F4&amp;amp;link_code=as1"&gt;Sinéad O’Connor – Throw Down Your Arms&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0009RJP3M/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=08EXM5GFC2ENZMF8TC5E&amp;amp;link_code=as1"&gt;Buck 65 – Secret House Against The World&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B0007NMJT0/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1MBYAT3K45GQTDCX58W0&amp;amp;link_code=as1"&gt;Nostalgia 77 – The Garden&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; 
    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00070G74G/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;adid=1CMFCBJ323BP578KRTPW&amp;amp;link_code=as1"&gt;The Perceptionists – Black Dialogue&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt; &lt;/ol&gt; 
    &lt;p&gt;&lt;b&gt; &lt;/b&gt;&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134361" width="1" height="1"&gt;</description></item><item><title>Comparing cloned objects</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/12/10/134246.aspx</link><pubDate>Sat, 10 Dec 2005 15:21:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134246</guid><dc:creator>anoras</dc:creator><slash:comments>35</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134246.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134246</wfw:commentRss><description>My co-worker &lt;a href="http://kjellsj.blogspot.com/"&gt;Kjell-Sverre Jerijærvi&lt;/a&gt; has &lt;a href="http://kjellsj.blogspot.com/2005/12/net-deep-clone-isdirty-check-using.html"&gt;posted a cool follow up&lt;/a&gt; to my &lt;a href="../../anoras/archive/2005/11/28/134032.aspx"&gt;“How to: Deep clone any serializable object”&lt;/a&gt;
post. His example shows a generic &lt;span&gt;IsClone &lt;/span&gt;method which uses
serialization and MD5-hashing to determine whether two different object
instances are clones of each other. Nice one, Kjell-Sverre.&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134246" width="1" height="1"&gt;</description></item><item><title>DuckUnit</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/12/07/134195.aspx</link><pubDate>Wed, 07 Dec 2005 23:29:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134195</guid><dc:creator>anoras</dc:creator><slash:comments>315</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134195.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134195</wfw:commentRss><description>&lt;P&gt;Some weeks ago I downloaded the new beta of &lt;A href="http://www.testdriven.net/"&gt;Test Driven .NET&lt;/A&gt;. As you might know the beta is available through &lt;A href="https://www.foldershare.com/"&gt;Folder Share&lt;/A&gt;, which basically is a peer to peer network. Trying to support Jamie’s excellent tool I kept the share open to help distribute Test Driven .NET. A cool side-effect from this is that I automatically get all the latest files downloaded to my computer. I’ve got my shared folder in a sub folder beneath My Documents, and my information client of choice; Jet Brains’ excellent Omea Pro keeps track of changes to files in My Documents. Earlier today I noticed that a mysterious, new folder named DuckUnit had appeared. When I opened the folder to take a closer look at what it was I discovered the creator of Test Driven .NET, &lt;A href="http://weblogs.asp.net/nunitaddin/"&gt;Jamie Cansdale&lt;/A&gt; was up to something again. DuckUnit is a testing framework that let’s you specify units test by applying a custom XML code comment named &lt;CODE&gt;test&lt;/CODE&gt; to your methods. For example:&lt;/P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;    /// &amp;lt;test x="1" y="2" z="3"&amp;gt;6&amp;lt;/test&amp;gt; &lt;BR&gt;    public int Sum(int x, int y, int z)&lt;BR&gt;    { &lt;BR&gt;     return x + y + z;&lt;BR&gt;    }&lt;/PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;
&lt;P&gt;The attributes correspond to the arguments of the method, and the inner text of the element to the expected result. The framework also lets you define your test data in separate XML documents, using the standard &lt;CODE&gt;include&lt;/CODE&gt; directive:&lt;/P&gt;&lt;CODE&gt;&lt;PRE&gt;    
    /// &amp;lt;include file="PrimeTests.xml" path="tests/test/" /&amp;gt;
    static bool IsPrime(int num)
    {
     int max = (int)Math.Sqrt(num) + 1;
     for (int count = 2; count &amp;lt; max; count++)
     {
      if (num % count == 0) return false;
     }
     return true;
    }&lt;/PRE&gt;&lt;/CODE&gt;
&lt;P&gt;The need to have some arbitrary test data to use within your unit tests is common. Usually I’ve restored to having &lt;CODE&gt;DataSet&lt;/CODE&gt;s with test data or serialized mock objects stored as XML within my test projects. I really like the idea of being able to inject test data into my unit tests in a declarative fashion. Especially when you can use the include statement to separate the test data from the actual test. I’d really like to see some examples of how to use more complex types as arguments for the test methods, but a primitives only solution is a good start. Maybe parameterless unit test soon will be a relic of days gone by?&lt;/P&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134195" width="1" height="1"&gt;</description></item><item><title>Dynamic Methods and Humane Interfaces</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/12/07/134193.aspx</link><pubDate>Wed, 07 Dec 2005 22:17:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134193</guid><dc:creator>anoras</dc:creator><slash:comments>1808</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134193.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134193</wfw:commentRss><description>&lt;p&gt;One
of the key differences between C-style languages such as C# or Java and
Ruby is how libraries are designed. The Ruby crowd has coined the term &lt;a href="http://martinfowler.com/bliki/HumaneInterface.html"&gt;“Humane Interface”&lt;/a&gt;
describing their style of defining class interfaces. A good example is
Ruby’s &lt;code&gt;List&lt;/code&gt; type which exposes a whooping 78 instance methods, while
.NET’s &lt;code&gt;ArrayList&lt;/code&gt; class has less than twenty if you leave out the
overloads. The generic &lt;code&gt;List&amp;lt;&amp;gt;&lt;/code&gt; in .NET 2.0 has some more, but
still the methods are all low-level. A good example of syntactic sugar
in Ruby’s &lt;code&gt;List&lt;/code&gt; is the &lt;code&gt;flatten&lt;/code&gt; method which flattens a multi-dimensional
array.&lt;/p&gt; 
    &lt;p&gt;&lt;code&gt;[1,2,[3,4,[5,6],7],8].flatten =&amp;gt; [1, 2, 3, 4, 5, 6, 7, 8]&lt;/code&gt;&lt;/p&gt; 
    &lt;p&gt; When I teach developers about refactoring, I often use an example I’ve borrowed from &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321213351/andersnorasbl-20"&gt;Joshua Kerievsky’s Refactoring to Patterns book&lt;/a&gt;
to show how code can be more readable or more humane if you like;
&lt;code&gt;November(20, 2004)&lt;/code&gt; where &lt;code&gt;November&lt;/code&gt; is a public static method accepting
the day of month and the year as its arguments. The &lt;code&gt;November&lt;/code&gt; method
communicates its behavior better compared to &lt;code&gt;new DateTime(2004, 11, 20)&lt;/code&gt;
which requires you to have knowledge of the &lt;code&gt;System.DateTime&lt;/code&gt; constructor.&lt;/p&gt; 
    &lt;p&gt;Examples
like the one above might seem a bit over the top, but successful Ruby
frameworks such as Ruby on Rails have similar methods that have been
essential to the libraries success. For instance; Ruby on Rails has a
&lt;code&gt;pluralize&lt;/code&gt; method which gets the plural form of most English nouns. Why
would you need such a method? The answer lies in Ruby on Rails
convention over configuration philosophy, where instances of a User
class are expected to be persisted in a Users table in the database.
The &lt;code&gt;pluralize&lt;/code&gt; method makes this convention easy to apply.&lt;/p&gt; 
    &lt;p&gt;John
Lam has been doing some really interesting experiments with programming
Ruby with the CLR, and his latest project is a great example of how
Ruby’s humane interface philosophy makes &lt;code&gt;Reflection.Emit&lt;/code&gt;, which is one
of the least approachable namespaces within the .NET framework, much
easier to use.&lt;/p&gt; &lt;code&gt;&lt;/code&gt;&lt;pre&gt;    create_ruby_method('say_hello') do&lt;br&gt;      ldstr 'Hello, World'&lt;br&gt;      call 'static System.Console.WriteLine(System.String)'&lt;br&gt;      ldc_i4_4 &lt;br&gt;      ret&lt;br&gt;    end&lt;/pre&gt;
    &lt;p&gt;Above
is an example of how to use his &lt;a href="http://www.iunknown.com/articles/2005/12/06/first-drop-of-rbdynamicmethod"&gt;RbDynamicMethod&lt;/a&gt; library to create a CLR
&lt;code&gt;DynamicMethod&lt;/code&gt; from Ruby. Although MSIL still is cryptic to most, being
able to write “MSIL code” within the source code is much easier than
using &lt;code&gt;OpCode&lt;/code&gt;s to emit MSIL code. Below is the same example using the
.NET 2.0 Lightweight Code Generation (LCG).&lt;/p&gt; &lt;code&gt;&lt;/code&gt;&lt;pre&gt;    public class DynamicMethodExample&lt;br&gt;    {&lt;br&gt;      public static void Main(string[] args)&lt;br&gt;      {&lt;br&gt;        DynamicMethod method = new DynamicMethod("SayHello", &lt;br&gt;               typeof(void), new Type[] {}, typeof(DynamicMethodExample), false);&lt;br&gt;        ILGenerator gen = method.GetILGenerator();&lt;br&gt;        gen.Emit(OpCodes.Ldstr, "Hello, World!"); &lt;br&gt;        gen.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine", &lt;br&gt;               new Type[] { typeof(string) }));&lt;br&gt;        gen.Emit(OpCodes.Ret);&lt;br&gt;       }&lt;br&gt;    }&lt;/pre&gt;
    &lt;p&gt;The
lightweight in LCG has its place. In .NET 1.x you could emit the Hello
World part of the above example in three lines of code, but you would
typically need approximately 10 more lines of code to setup the classes
needed to do this. The LCG is a huge improvement, but I still find
John’s MSIL code more appealing than using reflection to get hold of
&lt;code&gt;MethodInfo&lt;/code&gt;’s and similar.&lt;/p&gt; 
    &lt;p&gt;Another example of how class
interfaces can be more humane is .NET’s &lt;code&gt;EventLog&lt;/code&gt; class which throws an
&lt;code&gt;ArgumentException&lt;/code&gt; with information on how to resolve the error when the
class is used without being properly configured. Such a message gives
developers instant clues on what might be wrong, and can save them
hours of mucking about with the debugger.&lt;/p&gt; 
    &lt;p&gt;The syntactic
sugar added to C# 3.0 and Visual Basic 9 in particular make the
languages more expressive, and the LINQ framework provides a great
abstractions allowing developers to do complex operation in just one or
two lines of code. These new additions to the .NET development
environment make the general developing experience more humane. Humane
interfaces are a trend that reaches way beyond the small Ruby
community, and you should always look for options to make your class
interface more humane. Even if your core classes might require more
maintenance over time, the client code will be easier to maintain since
the code base will be much smaller, more expressive and readable.&lt;/p&gt;&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134193" width="1" height="1"&gt;</description></item><item><title>Dating Patterns</title><link>http://www.dotnetjunkies.com/WebLog/anoras/archive/2005/12/02/134122.aspx</link><pubDate>Fri, 02 Dec 2005 22:54:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:134122</guid><dc:creator>anoras</dc:creator><slash:comments>1501</slash:comments><comments>http://www.dotnetjunkies.com/WebLog/anoras/comments/134122.aspx</comments><wfw:commentRss>http://www.dotnetjunkies.com/WebLog/anoras/commentrss.aspx?PostID=134122</wfw:commentRss><description>&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0974312002/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;link_code=as1"&gt;&lt;img src="http://images.amazon.com/images/P/0974312002.01._AA240_SCLZZZZZZZ_.jpg" align="left" border="0"&gt;&lt;/a&gt;I came across &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0974312002/andersnorasbl-20?creative=327641&amp;amp;camp=14573&amp;amp;link_code=as1"&gt;a book called Dating Patterns by Norwegian writer Solveig Haugeland&lt;/a&gt;
at Amazon, and it is the ultimate Christmas gift idea for any geek
singleton. It is unlikely that I’ll practice any of the patterns in the
book since my significant other strongly disapproves “multi threading”,
but I’ve been through many of them unconsciously during my bachelor
days. I tried to come across a Cary Grant Helper, but at the end of the
day I probably was more of a &lt;a href="http://www.cafepress.com/datingdesign.9218295"&gt;Half Bad Boy Plus Protocol&lt;/a&gt;. Thinking back, I’ve probably got plenty of material for a dating anti-patterns book of my own.&lt;img src="http://www.dotnetjunkies.com/WebLog/aggbug.aspx?PostID=134122" width="1" height="1"&gt;</description></item></channel></rss>