Faced a situation when the application settings have become very difficult. Everything stored in the config was not only not convenient but also very problematic. the question arose in general to make everything in a separate project and store everything in json, as an option. Perhaps there are other options or more flexible solutions. I would be grateful for the advice.
- Brevity - sister olympiadnika. Can you elaborate and boringly describe the situation? If your config in its sense was first a hash, but then evolved into a tree, then yes, store it in JSON or XML. There are other options. For example, I like configs with curly brackets, where you don't need to enclose strings in quotes. - user239133
- @AlexanderZonov - there are about a dozen projects. There is a common scop of settings with the same values - for example, the address of the service for getting the list of clients is one for all. There is a unique data for each project, for example, the addresses are different. Or, for one project, session settings are needed for another something else. So, there was a desire to bring all this into a separate project so that all other projects use the same configurable settings library. In the future, there may also be a situation where the return value will depend on who requested and with what parameters. - Alex
- oneIt seems to be (if I understood everything) it turns out that there is a common config in which the default options are stored, and for each project there is an individual config in which these options can be overwritten. At this step, a separate project (configuration server) is still not needed. But further, with regard to "who requested and with what parameters" - you already need a separate application that generates configs depending on the parameters. But it may be just a script, not an application in terms of your IDE. - user239133
|