noleme/noleme-vault

Configuration: better programmatic API for Definitions

eledhwen opened this issue · 1 comments

The Definitions set of API wasn't originally intended to be user-facing, but was rather designed as a "barebones" Java representation of the configuration file contents.

However, a very useful feature was added when it was made possible to dynamically extend configurations:

var vault = Vault.with(
    "myconf.yml",
    defs -> {
        defs.setVariable("a", 123);
    }
);

As it stands, although it is functional the API isn't at all developer friendly. The various method contracts mirror the needs of the parser and not those of a developer.

With #2 possibly coming to life, which necessarily comes with significant modifications to the Java representation of configuration entities, a fresh coat of paint should be applied on the user-facing part of this API.

Some work has been done on this front, nothing revolutionary but the Definitions class is now easier to use and its structure should be easier to understand (even though it gained new features like tags). Some features like VaultAdjuster which made the problem more prominent have had their scope reduced.

All in all this issue is now considered deprecated.