Dear Emily,
here are my 50 Cents on this:
Concerning question 1: yes, I like empty values
For me it makes a difference if a property is present but empty, or if it is null.
There are plenty of use cases for empty properties (like custom prefixes or suffixes).
If a property is null in contrary, I would like to be able to provide a default value myself, which I wouldn't do, if it is empty.
Concerning question 2: no idea
It depends on the definition of "configuration". If "configuration" is always deemed to be "read only", than the erasing of a property simply makes no sense.
I "configuration" to the contrary is something that is "mutable", than erasing must be possible. Nevertheless it gets tricky here, if a configuration item is defined on several sources and some sources are "ready only" (as e.g. environment variables) whereas other are "modifiable" by the application (as e.g. system properties or files). It must than be ensured, that if a simple "= null" (aka removal) of a single property does not lead to a consecutive search on the next invocation, meaning that an explicit "remove" list must be maintained, which increases programmatic complexity.
I would go for a "read only" API but offer a simple "clone-like" mechanism into a similar data structure that is mutable and which may also be able to handle deletes. But for the 95% of cases the overhead makes imho no sense.
hth, Philip
--
You received this message because you are subscribed to the Google Groups "Eclipse MicroProfile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microprofile...@googlegroups.com.
To post to this group, send email to microp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/microprofile/0dc89d7e-4614-4a2e-9a9c-7343ca106254%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
|
I can't think of any reason why I would want to set an empty config value specifically.
Better question is: Why not? Solving a problem domain isn't about knowing each individual use-case, it is about accommodating every possible unimagined use-case. Libraries solve problem domains, not solution domains.
In @DeltaSpikeTeam weused an empty value to ‚erase‘ a lower ordinal config. This has the effect to make the code fall back tomthe programmatic default behaviour. In other words „“==null
Depending on the environment, we may have to use a proxy for some http calls. As the config keys list is consistent across environments, we may have to set the proxy config value to "" in some config files, and handle the http client accordingly in our application.
To unsubscribe from this group and stop receiving emails from it, send an email to microp...@googlegroups.com.