You see it all the time. This mainly works with legacy code that is already static or sealed or does not implement any interfaces. Although the base class is instead of an interface, HttpContextBase is the most striking example that I can think of.
, , , , . Injection, , , , .
, , , .
( ) - Singleton. :
public class Foo : IFoo
{
private readonly static Foo instance = new Foo();
private Foo() { }
public static Foo Instance
{
get { return Foo.instance; }
}
public void InterfaceFoo()
{
Foo.LegacyFoo();
}
public static void LegacyFoo()
{
}
}
, , , - Singleton.
, Foo.LegacyFoo();