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 ...
05-02-2008 12:55 PM