There are two core design patterns for the scope of objects used to configure a Python application:
- A global property map: A global object can contain all of the configuration parameters. A simple class definition is perhaps an ideal way to provide names and values; this tends to follow the Singleton design pattern ensuring that only one instance exists. Alternatives include a dictionary with pairs of name: value, or a types.SimpleNamespace object of attribute values.
- Object construction: Instead of a single object, we'll define a kind of Factory or collection of Factories that use the configuration data to build the objects of the application. In this case, the configuration information is used ...