Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please Read: Requiring default values for 2.0 + related changes #36

Open
A248 opened this issue Jul 29, 2023 · 0 comments
Open

Please Read: Requiring default values for 2.0 + related changes #36

A248 opened this issue Jul 29, 2023 · 0 comments
Labels
feedback wanted Feedback especially wanted on this issue
Milestone

Comments

@A248
Copy link
Owner

A248 commented Jul 29, 2023

Requiring Default Values
On our existing trajectory, DazzleConf 2.0 will be taking a more expansive role with respect to providing default values. We may therefore require the existence of default values when a configuration is defined, e.g. via @DefaultBoolean, @DefaultInteger, @DefaultString and related annotations.

Requiring default values would invalidate the "defaults from a resource file" approach documented in The two ways of using DazzleConf. However, that approach seems to be much rarer (if it exists at all) compared to the mainstream, common style.

Please comment here and describe your use-case if you use DazzleConf 1.x without defaults annotations. We would like to support all library usages when developing DazzleConf 2.x. However, we need your feedback if you use this

Related Plans
Sometimes, software may want to supply a different default value depending on whether a whole fresh configuration is generated versus an individual option was missing due to an upgrade. For example, I might introduce an option whose default setting changes behavior in the new version, but wish to keep backwards compatibility for existing configurations. DazzleConf should address this use-case by defining a default value as well as an "if missing" value. For example, @DefaultString("default for fresh configuration", ifMissing = "default for when the option itself is missing").

Migration should also be supported for configurations, with existing values being taken from other configuration options, sections, and even separate files and sub-sections of other files. We further need to account for the dynamic case of multiple new options inheriting from multiple previous options in an interacting fashion, i.e. a M:N relationship between old and new options. Such feature will require caller hooks to handle the specifics of migration.

@A248 A248 added the feedback wanted Feedback especially wanted on this issue label Jul 29, 2023
@A248 A248 added this to the 2.0.0 milestone Jul 29, 2023
@A248 A248 pinned this issue Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback wanted Feedback especially wanted on this issue
Projects
None yet
Development

No branches or pull requests

1 participant