What is a good method of persisting application properties?

前端 未结 8 1960
不思量自难忘°
不思量自难忘° 2021-01-05 09:43

I have a series of application properties which all have different types.

The types could include, booleans, dates, timestamps, or strings.

I need to be abl

8条回答
  •  再見小時候
    2021-01-05 10:20

    Assuming you are using Java, take a look at apache commons DatabaseConfiguration (http://commons.apache.org/configuration/apidocs/org/apache/commons/configuration/DatabaseConfiguration.html).
    Basically, what it does is pretty simple. It scans a table that has key-value pairs and exposes that table as a java.util.Properties. You can use this to load your application properties from the database.
    Once loaded, you can cache these properties in your application. Remember to invalidate this cache whenever you make changes to the application properties.

提交回复
热议问题