Home > .NET, CLR > Solution to Ayende’s Challenge

Solution to Ayende’s Challenge

I have always wanted to solve this puzzle Ayende posted on his blog, but haven’t got around it until today. It was a really hard puzzle, but with a little hint from Marc Gravell in the comments I was able to find a solution strategy based on .NET Remoting. Because Ayende’s original challenge was quite a bit harder (and actually impossible to solve, I wish I knew before) I tried messing with the typeof/new operators first. Sadly this isn’t possible and modifying any IL wasn’t allowed. On the other hand I learned a lot about the CLRs type system.

.NET Remoting is really interesting stuff, but to be honest I wouldn’t want to deal with it’s huge complexity in my every day job. I am not really sure which blank it fills in, besides interacting with ugly COM servers. If I compare all this stuff to Objective-C, I do now know about the benefits of  late-bound, message-passing style function calls. Solving this challenge in Objective-C would have been substantially easier (a simple NSProxy plus Method Swizzling, just what OCMock does).

Anyway, you can find my solution on github.

Advertisements
Categories: .NET, CLR
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: