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
If there is a reasonable chance that an abstract entity (interface or abstract class) might need to be disposable, it should implement it. Stream
, for example doesn't itself need IDisposable
, nor does IEnumerator
...
An abstract base class may be simpler, as you can have a default (empty) implementation of Dispose()
then, and possibly the finalizer / Dispose(bool) pattern, i.e.
void IDisposable.Dispose() { Dispose(true); GC.SuppressFinalize(this); }
protected virtual void Dispose(bool disposing) {}
~BaseType() {Dispose(false);}