持久化应用程序属性的好方法是什么? [英] What is a good method of persisting application properties?

查看:98
本文介绍了持久化应用程序属性的好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一系列的应用程序属性都有不同的类型。



类型可能包括布尔值,日期,时间戳或字符串。



我需要能够提供管理用户更改这些属性的能力,并让系统记住/将它们保存到一个文件。



我正在寻找一种最佳实践方法来存储这些应用程序属性,并能够持久化它们,并在启动时加载它们。

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆