Uploaded image for project: 'Joshua (Retired)'
  1. Joshua (Retired)
  2. JOSHUA-275

Revamp the Configuration System

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.1, 6.2, 7
    • 6.2
    • None
    • None

    Description

      I'd like to propose we centralize Joshua's configuration system to make use of typesafe/config https://github.com/typesafehub/config . This config system looks like JSON but with comments so it's easy to read. Because it's JSON it supports hierarchies of configurations, lists of configuration etc quite easily. It has some nice features like parsing time automatically. The main advantage here though is that we have a standard config system that doesn't have to be manually parsed.

      Here's a quick example of how we can use it:

          @Inject    
          public PackedGrammar(@TypesafeConfig("PackedGrammar.grammar_dir")
                               String grammar_dir,
                               @TypesafeConfig("PackedGrammar.span_limit")
                               int span_limit, 
                               String owner, 
                               String type) throws FileNotFoundException, IOException ...
      

      and then a config similar to

      # Joshua configuration file

      config = {
          default-non-terminal = X
          goal-symbol = GOAL
          ...
          
          PackedGrammar: {
              type: thrax,
              grammar_dir: /local/grammars/...
              span_limit: 50
          }
          ...
      }
      

      Version: TBD, but it's a breaking change so we may consider putting it in Joshua 7.

      Totally open to other config / injection systems if others want to suggest any of their favorites.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kellen.sunderland Kellen Sunderland
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: