Skip to content

Configuration Facility Design

Ilya Sher edited this page Feb 25, 2019 · 2 revisions

Background

Software needs configuration to operate (except for very basic or one off software with hard coded configuration).

Requirements

  • Support for configuration sources
    • Command line switches
      • Must not interfere with arbitrary processing of command line arguments by the main program
    • Environment variables
    • Structured files
    • Maybe: runtime configuration using API
  • Ability to provide different data types, not only strings (as typical for environment variables and command line switches).

Design (WIP)

  • Priorities of configuration source (low to high)
    • Configuration files
      • System-wide
      • Home directory (somewhere under home directory to be more specific)
    • Environment variables
    • Command line switches

TODO / Open issues

  • Take another look at Spring for ideas
  • Which other frameworks to look at?
  • Do we need schema on order to know how to parse?
  • Consider dependency injection (where the types/objects are configured by this configuration system)
  • Check .local folder and do more general research on where config files should go
  • Debugging is already configured using the DEBUG environment variable
    • Think about compatibility
    • Design switching debugging configuration to the new (this) system
  • Consider overriding/merging behaviour for lists (Arr) and dictionaries (Hash)... or any other types of containers
  • Consider ++ as end-of-configuration marker for command line arguments.
    • ... but not after -- ?

Additional information

  • See config() method