Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a component factory #40

Open
ecourtial opened this issue Jun 15, 2020 · 1 comment
Open

Create a component factory #40

ecourtial opened this issue Jun 15, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ecourtial
Copy link
Collaborator

@ecourtial ecourtial commented Jun 15, 2020

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
@ecourtial ecourtial added enhancement New feature or request good first issue Good for newcomers labels Jun 15, 2020
@kdebisschop
Copy link
Collaborator

@kdebisschop kdebisschop commented Dec 27, 2020

This might be a good way to create an optional logger interface as a standard interface of a Step and inject a single logger for an overall pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants