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

make ConfigManager from documentation part of api #41

Open
gepron1x opened this issue Aug 30, 2023 · 1 comment
Open

make ConfigManager from documentation part of api #41

gepron1x opened this issue Aug 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@gepron1x
Copy link

The ConifgManager example simplifies use of DazzleConf a lot. I copy and paste it to projects i work on. So, why not to include the class in the api itself?

@A248
Copy link
Owner

A248 commented Aug 30, 2023

The only thing we'd need to consider is that the wiki example is opinionated. It uses System.err.println and ex.printStackTrace, which libraries should never do. It also depends on SnakeYaml. The current ConfigurationHelper is supposed to reduce as much boilerplate as possible without requiring opinionated handling.

More importantly, however, for 2.0 we are probably going to couple configuration loading more closely with defaults handling (#36). Then we'd provide a hook for invalid values (#42), which corresponds to the second catch block in the wiki example. This might obsolete the use of classes like ConfigurationHelper entirely, or at the least, reduce their volume of code.

Perhaps we should consider a higher-level module such as dazzleconf-helper in addition to the core and format-specific modules. Then the base abstractions would reside in core, whereas more opinionated presets would come in the helper. Although, I must say, DazzleConf has always been opinionated, to an extent, by design.

@A248 A248 added the enhancement New feature or request label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants