I am often in the following situation:
- I have a config file, specifying the path to a resource file
- This config file gets parsed and the values (e.g., file path) are stored in a ConfigStore object
- A business logic object needs to content of the resource file.
Now who should actually read the resource file?
- The Business Logic Object
- A special parser
I don't like any of the 3 options: Both 1 and 2 violate the single responsibility principle, on the other hand, since file io is only a few lines, introducing a special parser class for this also seems like an overkill.
So who should read the file?