Using configuration parameters
One option to provide access to configuration parameters is to load them at startup and pass them as arguments to the functions. In this case, every time a new configuration parameter is added, it may result in the change of the function signature that can affect all the functions dependent on it.
Configuration parameters must not be tied directly to the arguments of the function because configuration parameters that are loaded at startup time may not change throughout the life cycle of the service. Instead, configuration parameters can be read once at startup and kept as immutable constants that can be directly accessed by all the functions that require one or more configuration parameter.
Reading the configuration ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access