Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Casey Charlton - Insane World

Hang the code, and hang the rules. They're more like guidelines anyway


Reflector Magic - How Hard is it to Abstract a Legacy System?

As it sort of came up via a previous post, and on the altdotnet mailing list ... I thought I would share a little secret with you ... abstracting out legacy systems can be pretty darn simple with a bit of Reflector magic!

Step One: Get Reflector

You can download it here if you don't already have it (how could you be writing code without it???)

Step Two: Get some Addins

There are some really cool ones at CodePlex

Make sure you get the Doubler Addin

Step Three: Run the Wrapper / Interface Generator

Pick your favourite legacy code base (MOSS is my particular favourite), pick your favourite nasty classes (SPList is just so damn sucky) ... and let Doubler work it's magic.

Voila!!!  ... no hard to write or maintain decorators, no painful legacy system to mock, and frankly, the Doubler code is so light that you don't even need to test it - just use MOSS as though it was a really well written piece of software (OK maybe that last bit is pushing the trade descriptions act a bit far).

Now you can use your favourite mocking framework, no need for the magic that some provide ...

 


Published May 02 2008, 12:55 PM by Casey Charlton
Filed under: , , ,

Comments

jdn said:

Doubler looks awesome, but any idea why Reflector says it fails to load it as an add-in?  Does it require an older version or something?

# May 2, 2008 12:11 PM

jdn said:

Disregard.  User error.

# May 2, 2008 12:19 PM

Weekly Links 2 « Davy Brion’s Blog said:

Pingback from  Weekly Links 2 « Davy Brion’s Blog

# May 3, 2008 7:17 AM

jdn said:

Since someone emailed me to ask:

Go to view/addins/add and choose the ReflectorDoubler.DLL and that's it.

# May 5, 2008 2:24 PM

redgreenrefactor said:

This came right on time for me. Thanks for sharing!

# May 6, 2008 1:52 PM

Peter Seale's weblog said:

# May 20, 2008 2:02 AM

The Inquisitive Coder » Blog Archive » Weekly Links 2 said:

Pingback from  The Inquisitive Coder  » Blog Archive   » Weekly Links 2

# May 24, 2008 10:14 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Casey Charlton

A somewhat passionate and opinionated developer, with occassional sparks of wisdom, and occasional useful information. Check out Devlicio.us!

Our Sponsors

Red-Gate!