Senior
How to store tariffs so that they can be changed without developer participation?
sobes.tech AI
Answer from AI
To store rates that can be changed without developer involvement, configuration files or external configuration management systems are usually used. For example:
- Store rates in a database accessible for modification through an admin panel.
- Use files in YAML, JSON, or XML format, which can be edited without recompilation.
- Apply configuration management systems (e.g., Consul, Spring Cloud Config) that allow dynamic parameter changes.
Example of storing rates in a JSON file:
{
"basic": 100,
"premium": 200,
"enterprise": 500
}
The application reads this file at startup or on a schedule, allowing rates to be changed without modifying the code.