I'm looking for patterns for parameterizing Python applications.
Approaches I can think of are:
- pass configuration objects or parameters down deep call hierarchies
- have a singleton configuration object (eg. a package that's initialized at application startup)
- register configurable parts of the application upon load (import), then call them once the configuration is read
- every configurable component parses its own configuration
They all feel weird in one way or another.
The question is: is there a better alternative, what are the pros and cons of these methods, is there a best practice and are there standard implementations that I'm not aware of?
Aucun commentaire:
Enregistrer un commentaire