Class names have been changed to protect the innocent.
If I have an interface named ISomeInterface. I also have classes that inherit the interface, FirstClass
It depends on your interface, but I'd lean toward #2. If you have two implementations of ISomeInterface
and only one needs disposing, then there's the possibility you need to refactor.
In general when you're binding to an interface, it's better to have that interface inherit IDisposable
rather than the base class; if your interface doesn't inherit IDisposable
, you must cast to IDisposable
to dispose of the object, and that runs the risk of an InvalidCast...