The goal of this library is to generate factories automatically, based on an interface.
For example, the idea would be to implement the following interface automatically.
public interface IFactory
{
IService CreateService();
}
The initial implementation would be a simple service locator, that gets IService from the container. The design may change along the way to support more complex scenarios.
Registration of factory interfaces should be simple, like:
services.AddSingleton<IService, Implementation>(); // Register the services
services.AddFactory<IFactory>(); // Register the factory
Design notes:
- Generating "code" at compile-time could be a good way of implementing this