1. <i id='udRdj'><tr id='udRdj'><dt id='udRdj'><q id='udRdj'><span id='udRdj'><b id='udRdj'><form id='udRdj'><ins id='udRdj'></ins><ul id='udRdj'></ul><sub id='udRdj'></sub></form><legend id='udRdj'></legend><bdo id='udRdj'><pre id='udRdj'><center id='udRdj'></center></pre></bdo></b><th id='udRdj'></th></span></q></dt></tr></i><div id='udRdj'><tfoot id='udRdj'></tfoot><dl id='udRdj'><fieldset id='udRdj'></fieldset></dl></div>

        <bdo id='udRdj'></bdo><ul id='udRdj'></ul>
    2. <legend id='udRdj'><style id='udRdj'><dir id='udRdj'><q id='udRdj'></q></dir></style></legend>
      <tfoot id='udRdj'></tfoot>

      <small id='udRdj'></small><noframes id='udRdj'>

        Java 配置框架

        Java configuration framework(Java 配置框架)
        <legend id='lsipG'><style id='lsipG'><dir id='lsipG'><q id='lsipG'></q></dir></style></legend>

              <tfoot id='lsipG'></tfoot>

                  <tbody id='lsipG'></tbody>

                <i id='lsipG'><tr id='lsipG'><dt id='lsipG'><q id='lsipG'><span id='lsipG'><b id='lsipG'><form id='lsipG'><ins id='lsipG'></ins><ul id='lsipG'></ul><sub id='lsipG'></sub></form><legend id='lsipG'></legend><bdo id='lsipG'><pre id='lsipG'><center id='lsipG'></center></pre></bdo></b><th id='lsipG'></th></span></q></dt></tr></i><div id='lsipG'><tfoot id='lsipG'></tfoot><dl id='lsipG'><fieldset id='lsipG'></fieldset></dl></div>
                  <bdo id='lsipG'></bdo><ul id='lsipG'></ul>

                  <small id='lsipG'></small><noframes id='lsipG'>

                  本文介绍了Java 配置框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在清除 Java 库中的所有硬编码值,并且想知道哪种框架最适合处理运行时配置(就零或接近零的配置而言)?我更喜欢基于 XML 的配置文件,但这不是必需的.

                  I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer XML-based configuration files, but it's not essential.

                  请仅在您对框架有实际经验的情况下回复.我不是在寻找例子,而是在寻找经验......

                  Please do only reply if you have practical experience with a framework. I'm not looking for examples, but experience...

                  推荐答案

                  如果你的硬编码值只是简单的键值对,你应该看看 java.util.Properties.它比 xml 简单得多,更易于使用,而且实现起来微不足道.

                  If your hardcoded values are just simple key-value pairs, you should look at java.util.Properties. It's a lot simpler than xml, easier to use, and mind-numbingly trivial to implement.

                  如果您正在使用 Java,并且您从磁盘存储或检索的数据被建模为键值对(在您的情况下听起来就像是这样),那么我真的想不出更好的解决方案.

                  If you are working with Java and the data you are storing or retrieving from disk is modeled as a key value pair (which it sounds like it is in your case), then I really can't imagine a better solution.

                  我使用属性文件在一个更大的项目中简单配置小包,并作为整个项目的更全局配置,我从来没有遇到过问题.

                  I have used properties files for simple configuration of small packages in a bigger project, and as a more global configuration for a whole project, and I have never had problems with it.

                  当然,这具有不需要任何第三方库来使用的巨大好处.

                  Of course this has the huge benefit of not requiring any 3rd party libraries to utilize.

                  这篇关于Java 配置框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Java Bytecode Manipulation Library Suggestions(Java 字节码操作库建议)
                  Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
                  About the use of Beans.xml configuration file in Spring Framework application(关于Spring Framework应用中Beans.xml配置文件的使用)
                  What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?(Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?)
                  Are there any android application framework like spring?(有没有像spring这样的android应用程序框架?)
                  Java Swing based game framework. Any advice?(基于 Java Swing 的游戏框架.有什么建议吗?)
                    <bdo id='cT1Pe'></bdo><ul id='cT1Pe'></ul>

                    • <tfoot id='cT1Pe'></tfoot>
                      <i id='cT1Pe'><tr id='cT1Pe'><dt id='cT1Pe'><q id='cT1Pe'><span id='cT1Pe'><b id='cT1Pe'><form id='cT1Pe'><ins id='cT1Pe'></ins><ul id='cT1Pe'></ul><sub id='cT1Pe'></sub></form><legend id='cT1Pe'></legend><bdo id='cT1Pe'><pre id='cT1Pe'><center id='cT1Pe'></center></pre></bdo></b><th id='cT1Pe'></th></span></q></dt></tr></i><div id='cT1Pe'><tfoot id='cT1Pe'></tfoot><dl id='cT1Pe'><fieldset id='cT1Pe'></fieldset></dl></div>
                        <tbody id='cT1Pe'></tbody>
                          <legend id='cT1Pe'><style id='cT1Pe'><dir id='cT1Pe'><q id='cT1Pe'></q></dir></style></legend>

                            <small id='cT1Pe'></small><noframes id='cT1Pe'>