Let’s just say, for arguments sake, that you’ve run across a piece of code that is tightly coupled, i.e. there are lots of hard links between classes, it’s hard to test, changes are difficult, the code breaks when it shouldn’t, etc. Let’s also say, for arguments sake, that you want to improve the design of that code and make it somewhat more maintainable so that you don’t spend the rest of your natural life trying to keep the code from completely falling apart.
How would you do that?
In this screen cast I’ll walk through a sample application, show where the tight coupling occurs and how to remove it. In the process I’ll also be cover a bit of unit testing vs integration testing, mock frameworks, and inversion of control containers (Unity in this case).
Hopefully you get some value from it.
Double click for full screen
- Unity v1.2 - http://codeplex.com/unity
- Rhino Mocks - http://ayende.com/projects/rhino-mocks.aspx
- Alt.Net – http://ozalt.net
- MSTest was used for unit testing
- Readify (a plug for my employer) – http://www.readify.net
For those interested in the Visual Studio add-ons they saw, I am using:
Finally, the video is hosted at http://silverlight.live.com.