You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're considering using governator in our projects and after giving it a try, I must say I'm impressed. Keep up the great work!
The one thing that's bugging me is the inability to check injected configurations at startup time. Let me give a simple example.
Sample class that uses a configuration mapping:
public class AppConfig {
@Configuration("baaar") String bar;
}
Example of reference.conf:
bar = 111
I'm using ArchaiusConfigurationProvider to read these configs.
As you can see the configuration mapping (baaar) is spelled wrong in our case, as it does not match any entry in the config file. In this case the appConfig.bar is going to be assigned null.
This simple typo can cause big problems down the road (null pointer exceptions & co). It would be awesome if we could choose to fail with a runtime exception when a configuration maps to an inexistent config. How would one achieve this?
For instance, a much smaller library (https://github.com/racc/typesafeconfig-guice) has this kind of support. It uses reflection to check all the injected fields to see if it maps to existing configs. Though it lacks the support for dynamic config on runtime, which is a pity.
The text was updated successfully, but these errors were encountered:
We're considering using governator in our projects and after giving it a try, I must say I'm impressed. Keep up the great work!
The one thing that's bugging me is the inability to check injected configurations at startup time. Let me give a simple example.
Sample class that uses a configuration mapping:
Example of
reference.conf
:I'm using ArchaiusConfigurationProvider to read these configs.
As you can see the configuration mapping (
baaar
) is spelled wrong in our case, as it does not match any entry in the config file. In this case theappConfig.bar
is going to be assignednull
.This simple typo can cause big problems down the road (null pointer exceptions & co). It would be awesome if we could choose to fail with a runtime exception when a configuration maps to an inexistent config. How would one achieve this?
For instance, a much smaller library (https://github.com/racc/typesafeconfig-guice) has this kind of support. It uses reflection to check all the injected fields to see if it maps to existing configs. Though it lacks the support for dynamic config on runtime, which is a pity.
The text was updated successfully, but these errors were encountered: