In some use case, we might need many instance of the same component (ETL, CSV Extractor...).
So far there is two way to proceed:
- Use DI. But your constructor could become huge.
- Use DI + clone. But become difficult to test.
We might consider to create a factory. It would be a class with one public method get(), with two parameters:
- The classname of the request component
- The optionnal array of the options
In some use case, we might need many instance of the same component (ETL, CSV Extractor...).
So far there is two way to proceed:
We might consider to create a factory. It would be a class with one public method get(), with two parameters: