polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: Configuration structure
Date Sun, 04 Jun 2017 11:23:27 GMT
initialValueProvider should be marked "incomplete" or something.

For the rest, not so sure I like it. I think I would prefer something more
composite-like, but not sure yet.

On Sun, Jun 4, 2017 at 7:01 PM, Paul Merlin <paulmerlin@apache.org> wrote:

> Maybe a silly idea, don't know, totally different, but ...
>
>
> interface MyConfig {
>
>   @UseDefaults( value = "user.home", source =
> DefaultsSource.SYSTEM_PROPERTIES )
>   Property<String> homeDirectoryPath();
>
>   @UseDefaults( value = "SOME_PORT", source = DefaultsSource.ENVIRONMENT )
>   Property<Integer> thePortWeWantToUse();
>
>   Property<List<String>> somethingElse();
>
> }
>
> Too much annotations, erk ...
>
>
>
> Looking at it this way the goal could be seen as providing default values
> per property.
>
> We already have the assembly time initial value provider that can do just
> that, or could be enhanced to (couldn't find tests for it ...). We could
> then provide some helpers for system properties / environment variables
> mapping.
>
> BTW, shouldn't InitialValueProvider be named DefaultValueProvider instead,
> for consistency?
>
>


-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message