I have been looking into the Castle project and specifically Windsor. I have been so impressed with what is possible with this technology and the benefits of having a such a loosely coupled system are definitely apparent. The only thing I am unsure of is if using this method has any downsides, specifically in asp.net? for example performance hits, etc.
I am trying to make the benefits of this approach visible to my fellow developers here and am being hit with the following comebacks:
That is using reflection and each time that an object is called from the container, reflection must used so performance will be terrible. (Is this the case? does it use reflection on every call?)
If I am relying on Interfaces; how do I deal with objects that have extra methods and properties which have been tacked onto the class? (through inheritance)
The one exception where performance of an IoC container is unacceptable in my experience is when trying to integrate/wrap the IoC container as an IServiceProvider for use in the ComponentModel - a once common example of this was when creating your own hosted winforms designer (normally to build some kind of custom designer, i.e. workflow/flowchart etc.)
Due to the way a number of winforms components behave, especially at design time, the cost of resolving a component will physically cause the mouse to "stutter" when dragging because the framework can make upwards of 30,000 service resolution calls a second - this is more a reflection on poor coding practices in the components themselves though I think, or at least due to assumptions being made about the service providers implementation being fast/simple.
In practice I've never found component resolution times to be a problem in even heavily loaded commercial applications.