3dcitydb / citydb-tool

3D City Database 5.0 CLI to import/export city model data and to run database operations
Apache License 2.0
9 stars 2 forks source link

Add config module #13

Closed yaozhihang closed 8 months ago

yaozhihang commented 8 months ago

This PR adds a new config module. The configurations like read and write options, import and export options, as well as plugin configs can be encoded in a JSON file and managed by this module.

Example config json: test-config.json

clausnagel commented 8 months ago

Thanks, @yaozhihang. I like the generic and thin config module. Gives us a lot of flexibility. So let's merge. If we think we need more predefined structure in the future, it's easy to add.

One minor question. Currently the config file would look like this:

{
  "configs:" {

  }
}

Should we use a @JSONField annotation to rename "configs" to "config" or "configuration"? I somehow prefer the singular form here because this is the config file. Or we could use "options"? And in future we could even add more metadata like version or type, for example:

{
  "type": "citydb-tool",
  "version": "1.0",
  "config:" {

  }
}
yaozhihang commented 8 months ago

Thanks, @yaozhihang. I like the generic and thin config module. Gives us a lot of flexibility. So let's merge. If we think we need more predefined structure in the future, it's easy to add.

One minor question. Currently the config file would look like this:

{
  "configs:" {

  }
}

Should we use a @JSONField annotation to rename "configs" to "config" or "configuration"? I somehow prefer the singular form here because this is the config file. Or we could use "options"? And in future we could even add more metadata like version or type, for example:

{
  "type": "citydb-tool",
  "version": "1.0",
  "config:" {

  }
}

Yes, agree. Done with c1259ff3