I am writing some code to parse some files (which I call "assets"), and I'm planning to structure this as three classes:
AssetParser will use objects of the other two classes to parse some parts of the assets.
I want to write this as three classes rather than one big class to split functionality into manageable fragments (that is I use something like structured programming, where methods of AssetParser call methods of the other two classes)
My question: Should I use dependency injection to create objects of
The parts of the parser are tightly coupled to the parsers. In my opinion, it is highly unlikely that
AssetParser would use other subparsers in place of
TransformersParser. So it looks like that dependency injection is not necessary here. (I can just use
new to create objects of
One reason to use dependency injection is that it allows easily make
TransformersParser singletons (if I will want to use singletons). Are there other reasons?