Odi's astoundingly incomplete notes
New entries | CodeCampaign for less configuration
I am currently cracking down on the amount of configuration of our product. Join the campaign and do the same for YOUR product:
- Define sensible default values for all parameters, thus eliminating the need to override them.
- Find configuration that is the same (nearly) everywhere and make that value the default. Then make the parameter optional.
- Identify parameters that have only one legal value. Treat like above or eliminate the parameter altogether. During a phase of backwards-compatibility warn if the parameter is set and tell the user to remove it.
- Complex object trees assembled with tools like Spring Beans can maybe hardcoded and produced by a factory, if feasible.
- If you want to go extreme, make the system smart to assume sensible default values at runtime, if they are not present in the configuration, and log the assumptions and decisions taken.
- Define required filenames or filename patterns instead of configuring them.
- Use a fixed package name, tagging interfaces or annotations and reflection to find a class dynamically at runtime instead of configuring its classname.
- Deduce class names from a context instead of mapping some property to classes in a configuration file.
Add comment