IoC and fluent interfaces

time to read 1 min | 156 words

You may have noticed that I like to play word games with code, so here is the Inversion of Control interface in Rhino Commons:

(Image from clipboard).png

The main goal is to be able to say:

ISender sender = (ISender)IoC.Container.Resolve("email");

The Initialize() method is called at application start, and will set everything up for the rest of the application. This class is to fetch the repositories, so I can generate a complex object graph and handle some interesting scenarios from the start, using generic decorators.

In the end, I didn't go with NHibernate / Transaction integration, for the simple reason that the Repository<T> and With.Transaction{} made them unnececary.