IDisposable – The oft misunderstood and misused interface
There are many blog posts and articles online which do an excellent introduction to the IDisposable interface, but most focus on just one aspect of this interface. In my view, it is too complex of a subject to be tackled in a single article.
Although the most commonly cited reason for using IDisposable is to wrap a native resource, the required implementation changes depending on whether you are directly wrapping a native resource, encapsulating a managed class which implements IDisposable, inheriting from an IDisposable class, or creating a factored type.
This series details each usage separately, and explains why the implementation should change in different scenarios.