I was reading Castle IoC reference manual and realized something that I have not thought of before. By using IoC facilities it’s really easy to implement certain patterns, especially since Castle is really designed to be extensible. In reality, some of the patterns are already implemented and supported. For example by default all components in the IoC container are of the singleton lifestyle. The beauty of the framework is that it’s really easy to change the lifestyle of the object to, for example, transient (new component per request), without having to change the class code. Since components are singletons by default, reusability of the objects is encouraged. This should save some memory and execution time.
Another cool feature of the Castle is that it’s really simple to configure components. In the past, I might have had to either write my own class to extract configuration from the .config file or use some configuration framework, like Nini. Now my components will automatically initialize with the supplied configuration. I might still have to use Nini when a complex configuration will be required and application will need to save it (save user options for example). But the whole config deal is going to be really simplified.