持久化应用程序属性的好方法是什么?

编程入门 行业动态 更新时间:2024-10-26 14:31:40
本文介绍了持久化应用程序属性的好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一系列的应用程序属性都有不同的类型。

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

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

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

解决方案

Java具有特定的功能为此目的 - 属性。 这是非常好的文章。

download-llnw.oracle/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

download-llnw.oracle/javase/tutorial/essential/environment/properties.html

更多推荐

持久化应用程序属性的好方法是什么?

本文发布于:2023-11-05 03:59:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1559833.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   持久   属性   方法

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!