Could a singleton type replace static methods and classes?
- by MKO
In C# Static methods has long served a purpose allowing us to call them without instantiating classes. Only in later year have we became more aware of the problems of using static methods and classes.
They can’t use interfaces
They can’t use inheritance
They are hard to test because you can’t make mocks
and stubs
Is there a better way ?…