Is it wrong to call a class a FooFactory if it doesn't always create Foo objects? For example if I have the following interface:
public interface IFooFactory
{
Foo Create();
}
and implement it as follows:
public class FooFactory : IFooFactory
{
public IFoo Create()
{
return ServiceLocator.Current.GetInstance<IFoo>();
}
}
then this class might create a Foo depending upon how my IoC container is configured. If the 'XxxFacotry' name should be reserved for true factories, what should I call my interface and class?
The obvious answer is IFooProvider, but I really want avoid 'XxxProvider' because it's overused and therefore too vague. On the other hand, IFooServiceLocator is far too specific.
Alternative naming suggestions greatly appreciated.