Wednesday, November 26, 2008

Inversion of Control

One of the things I have been trying to learn for a while is inversion of control (IOC) and dependency injection (DI). I tried to playing with and I just couldn't get it to work. The other day I downloaded Castle project and played with Castle Windsor, and found it rather easy to use, or at least it has better examples.

I have now started working on a project using IOC and DI to create the base framework for my personal development.

The first step I'm working on is the Data Access Layer and data objects. I'm building a generic data request object that I can use to request data from MySQL, Oracle, Sql Server, XML file, or a web service and using IOC I can change the data source by simply changing a config file, and the rest of the application will never know.

when I'm a little further along I'll post the some of the code. All of this on my way to learning how to create better, more testable code, working my way to doing agile Test Driven Development.

No comments: