You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce very simple DI to make current solution more extendable.
What
Due full IoC containers add unnecessary complexity and reduce performance I would offer "Factory configurator" pattern.
Instead of hosting anything like IoC containers, factory configurator will take reference only for implementations of the concrete interfaces (see example below). OTel repo will host DefaultFactoryConfiguration and a distro will host eg: SplunkFactoryConfiguration where it could override the sub services / factories or construct whole implementation from scratch. Factory configuration type could be loaded either from environment variable, from static, etc. IFactoryConfiguration reference must be passed down the line (I expect it will be in the Tracer instance?)
nit: I would prefer to have methods in interfaces than properties like
class SomeFactoryConfiguration : IFactoryConfiguration
{
// Singleton services
public IMyService MyService() => new MyDistroService();
// Transient services
public IMyFactory MyFactory() => new MyDistroFactory();
}
Why
Introduce very simple DI to make current solution more extendable.
What
Due full IoC containers add unnecessary complexity and reduce performance I would offer "Factory configurator" pattern.
Instead of hosting anything like IoC containers, factory configurator will take reference only for implementations of the concrete interfaces (see example below). OTel repo will host
DefaultFactoryConfiguration
and a distro will host eg:SplunkFactoryConfiguration
where it could override the sub services / factories or construct whole implementation from scratch. Factory configuration type could be loaded either from environment variable, from static, etc.IFactoryConfiguration
reference must be passed down the line (I expect it will be in the Tracer instance?)This feature is connected to: #117
The text was updated successfully, but these errors were encountered: