This could certainly work but it loses the benefit of abstracting out the extractors. The idea is that each extractor knows what it can extract and it indicates that with the function that finds it.
This provides nice encapsulation by allowing the class that implements the interface to decide what it can extract.
Your idea would be quite different and more akin to the Factory pattern.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This could certainly work but it loses the benefit of abstracting out the extractors. The idea is that each extractor knows what it can extract and it indicates that with the function that finds it.
This provides nice encapsulation by allowing the class that implements the interface to decide what it can extract.
Your idea would be quite different and more akin to the Factory pattern.