I've been studying code of some different libraries, and notice that some will provide equivalent generic and non-generic functions in the same class.
One example is the IServiceLocator interface of the Common Service Locator project:
public interface IServiceLocator
{
object GetInstance(Type serviceType);
object GetInstance(Type serviceType, string key);
IEnumerable<object> GetAllInstances(Type serviceType);
TService GetInstance<TService>();
TService GetInstance<TService>(string key);
IEnumerable<TService> GetAllInstances<TService>();
}
The impression I get is that this is for maximizing accessibility, perhaps from COM. Absent those concerns, this seems like redundant code. Is there anything I'm missing?