应用配置文件 [英] Application configuration files
问题描述
我们的大部分代码目前都是Java,所以我们一直在关注 Apache Commons Config ,但我们发现它非常冗长。我们还查看了 XMLBeans ,但似乎有很多不为人知的事情。我也觉得好像我被推向XML作为一种格式,但我的客户和同事都对尝试别的东西感到担忧。我可以从客户的角度理解它,每个人都听说过XML,但是在一天结束时,不应该使用正确的工具吗?
什么格式和库是人们现在在生产系统中使用的,是否有其他人试图避免使用角支架税收?
编辑:确实需要成为跨平台的解决方案:Linux,Windows,Solaris等选择用于与配置文件接口的库与选择格式同样重要。
XML XML XML XML。我们在这里讨论配置文件。如果您没有在性能密集的情况下序列化对象,则没有角括号税。
除了机器可读之外,配置文件必须是人类可读且易于理解的。 XML是两者之间的一个很好的折衷方案。
如果您的商店有人害怕那种新奇的XML技术,我会为您感到难过。
OK, so I don't want to start a holy-war here, but we're in the process of trying to consolidate the way we handle our application configuration files and we're struggling to make a decision on the best approach to take. At the moment, every application we distribute is using it's own ad-hoc configuration files, whether it's property files (ini style), XML or JSON (internal use only at the moment!).
Most of our code is Java at the moment, so we've been looking at Apache Commons Config, but we've found it to be quite verbose. We've also looked at XMLBeans, but it seems like a lot of faffing around. I also feel as though I'm being pushed towards XML as a format, but my clients and colleagues are apprehensive about trying something else. I can understand it from the client's perspective, everybody's heard of XML, but at the end of the day, shouldn't be using the right tool for the job?
What formats and libraries are people using in production systems these days, is anyone else trying to avoid the angle bracket tax?
Edit: really needs to be a cross platform solution: Linux, Windows, Solaris etc. and the choice of library used to interface with configuration files is just as important as the choice of format.
XML XML XML XML. We're talking config files here. There is no "angle bracket tax" if you're not serializing objects in a performance-intense situation.
Config files must be human readable and human understandable, in addition to machine readable. XML is a good compromise between the two.
If your shop has people that are afraid of that new-fangled XML technology, I feel bad for you.
这篇关于应用配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!