Skip to content
Eric edited this page Mar 27, 2017 · 24 revisions

AndHow! strong.valid.simple.AppConfiguration

Features

  • Strong Typing. Configuration Propertys are typed and only return that type. The getValue() method of the StrProp (String Property) returns a String. The getValue() method of an IntProp (Integer Property) returns an Integer.
  • Detailed validation. Each Property can be required or optional. Strings can be matched to regex, bounds applied to numbers, etc..
  • Simple construction via builders.
  • Simple initial configuration via auto-generated sample files.
  • Use configuration Properties in code just like Java constants, e.g.: MY_CONFIG_PROPERTY.getValue(); This eliminates a problematic aspect of most configuration strategies, which require value keys buried in your source code, e.g.: hashMap.get("HiddenMagicKey");
  • Fail-Fast. Type conversion and validation are applied at startup, rather than at use.
  • Managed session. A single application configuration initiation point is enforced. Race conditions or missing initiation fails rather than returning null for properties.
  • Consolidated and structured application configuration API. Configuration Properties include a type, description, and validation rules. Properties can be grouped into logical sets with descriptions. Libraries/modules can present their entire configuration API as a PropertyGroup.
  • Extensible value types and configuration sources. New types and sources of configuration (such as from a db) can be easily added.
  • Clear error messages. Using Property validation rules and type data, detailed error messages can be constructed.
Clone this wiki locally