持久化应用程序属性的好方法是什么? [英] What is a good method of persisting application properties?
问题描述
类型可能包括布尔值,日期,时间戳或字符串。
我需要能够提供管理用户更改这些属性的能力,并让系统记住/将它们保存到一个文件。
我正在寻找一种最佳实践方法来存储这些应用程序属性,并能够持久化它们,并在启动时加载它们。
Java具有特定的功能为此目的 - 属性。
这是非常好的文章。
http://download-llnw.oracle.com/javase/tutorial/essential/environment/properties.html
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 able to provide the ability for administrative users to change these properties and have the system to remember / persist them to a file.
I am looking for a best practice way to store these application properties and be able to persist them on change and load them on start up.
Java has a facility built specifically for this purpose - Properties. Here is very good article about it
http://download-llnw.oracle.com/javase/tutorial/essential/environment/properties.html
这篇关于持久化应用程序属性的好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!