I saw the following pattern used in many places:
abstract class SimpleProvider<T>
{
public object Create(IContext context)
{
return CreateInstance(context);
}
protected abstract T CreateInstance(IContext context);
}
I do not understand the practical difference why it is not just written as:
abstract class SimpleProvider<T>
{
public abstract T Create(IContext context);
}
UPDATE: The above snippet taken from the documentation for Ninjectwhere the interface is not specified, but looking at the actual source, I see that it SimpleProvider<T>implements an interface IProviderthat explains the need for a subtitle and the answers to my question.
source
share