That's a fairly good point. Without DI this class would probably indeed have the responsibility of instantiating those classes, but the DI pattern we're using implies the instances will be instantiated somewhere else (Spring's container, for instance) and injected through the constructor.
Maybe we could have the DataHandlerSelector, and then a DataHandlerSelectorFactory to do the actual instantiation of all the classes involved, I guess it would be more accurate.
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.
That's a fairly good point. Without DI this class would probably indeed have the responsibility of instantiating those classes, but the DI pattern we're using implies the instances will be instantiated somewhere else (Spring's container, for instance) and injected through the constructor.
Maybe we could have the DataHandlerSelector, and then a DataHandlerSelectorFactory to do the actual instantiation of all the classes involved, I guess it would be more accurate.