Considerations for Using Config Module vs. Parameters for Runtime-Changeable Data
When creating services, it's quite tempting to lean on the Config module to not have to take in a bunch of paramerters. However, I'm a bit worried that using config (e.g.
Config.string) might not be the best solution for things you expect to change runtime? Let's say I have an app where most data are tied to a "project", and then most of my services needs to know what the current project is. Then it's tempting to just use Config.string("PROJECT") everywhere in stead of providing project as a parameter all over the place. But that might perhaps be a footgun? Since it's very easy to miss providing or changing the project during development, and you don't get any type hints that you need to provide the project. Should you in these cases rather create a project service that only return the current project? Or is that also a footgun, since you might forget to change/override the project service when you need to do actions agains a different project.