I know that the Singleton design pattern is frowned upon for various reasons. They're not easy to mock for unit testing, they're not thread safe, etc, etc. But now and again, I'm faced with a situation where an application is driven by a configuration file (application metadata). Everything about this application is contained in its configuration file (let's say json, that the app downloads when its config changes). The only purpose of this app is to serve the user a UI that wraps the configuration and allows flow. Without this config file, the app is useless. I'm thinking that this is a pretty common scenario for a lot of applications.
So given an application that's 100% driven from a config file, how would you design code to avoid using a singleton? Would you constantly read from this json file only when needed, and only a specific section? Meaning, you'll have to deserialize the json into objects whenever the UI calls for it? I mean, isn't this config file the same thing as a singleton anyway? I'd be interested in hearing how people would approach this.