I'm trying to see if I understand depedency injection.
I have a project that is used as a parser. It can parse delimited text, key-value and will also regex.
The first way this was done was in one function with a switch. The next way was to put it in seperate functions and call it based on a switch
The next way I was thinking was to create an interface and than implement a class for each type. Is that to much work? Does the question come down to function or will doing this show benefits that I don't see yet.
I believe my problems stems that I was initially going to implement an interface and than for each time I needed a different parsing implement a new class. But than that would still require me going in and adding that to some type of logic flow as I don't see how to do that with injection frameworks.
So say I add in another way to parse that is based on tags or xml. Create the class implementing the interfaces and than I would need to add them to the flow logic to instantiate them as that interface if a user chooses to parse that type of text. Any clearner way to do that?