Example · a fictional codebase
Capsule: ConfigurationMigration
Invariant
MyConfig is still in use but deprecated. Use MyNewConfig instead.
Why
MyNewConfig validates typed settings at startup, so missing or invalid values are caught before requests arrive. MyConfig remains for callers that haven’t migrated; adding new callers prolongs the migration.
Example
For a new retry timeout, add a typed setting to MyNewConfig rather than another string-key lookup through MyConfig.
Depth
- Preserve configuration keys and defaults when migrating an existing caller.
- Remove
MyConfigonly after its last caller has migrated.
src/config/MyConfig.cssrc/config/MyNewConfig.csfile:///src/config/MyConfig.cs;file:///src/config/MyNewConfig.cs;file:///src/**/*.cs;file:///tests/config/**/*Migration*.cs