Skip to content

Consider Initialization on demand for ConfigurationProviderResolver #55

@agentgt

Description

@agentgt

The ConfigProvider (EDIT on name... apologies) has a static initializer.

For static initialization I usually use this pattern See https://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom to avoid unnecessary loading.

Thus

private static final ConfigProviderResolver INSTANCE = ConfigProviderResolver.instance();

Should be:

private static class LazyHolder { private static final ConfigProviderResolver INSTANCE = ConfigProviderResolver.instance(); }

Also sort of off topic but I was actually trying to get a configuration standard 2 years ago: https://github.com/agentgt/configfacade

I didn't have the clout or time to devote to pushing it so I'm excited about the future of this library.

I hadn't separated out enough of the "helper" functionality from the base interfaces in my version as I was still experimenting with the ergonomics of the library as well as I was also trying to add reloadable behavior and listeners (similar to archaius).

I think reloadable/listening behavior is important and might file an issue to maybe add support if thats OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions