Configuration,J2EE通天塔的混乱之源

原创 2003年11月27日 00:33:00

Java应用程序获得配置信息的方式可谓千奇百怪,配置文件的安排也毫无章法,每个人或许都有自己的一套读/写配置信息的习惯做法。“如果应用程序体系结构是巴别塔,配置就是让巴别塔项目陷于混乱的‘语言’。”

————————

If architecture were to be the tower of babel, configuration is its language

Satya Komatineni (November 25, 2003 7:37AM PT)
» Permalink

As the story goes God devised multiple languages so that men can't build sturctures that span to the heavens. In our small world of programming architectures the men and women of the world are quite busy (with out much help from any Overseer) constructing a confusion of their own. The name of this confusion is called "Configuration".

The larger and more complex an architecture is the simpler its constituents need be. That means the key for complex programs are pluggable parts or pluggable functionality at run time. Almost like a self-evolving system. The key to accomplishing such a composition is configuration. We seem to invent for every configuration need a different configuration api.

Sometimes configuration is read from properties files. Some times from XML files. Sometimes from System.properties. Sometimes passed in as a properties object. Sometimes read from multiple config files. Sometimes libraries use a different confgiuration than applications.

Such diversity of configurations exists because it is fairly easy to read configuration at run time. So it is left to the individual programs and components to determine their own needs.

But I am realizing more and more that it is the configuration that holds an architecture together. When there all the parts and containers use the same understanding of a configuration then it is lot more easier to integrate parts from varieties of sources and manage them well. The key to this understanding is to arrive at a unified abstraction for configuration that is based on the "structure" of the data rather than the form. This insight is as important as knowing the difference between XML and an InfoSet.

Once the configuration is perceived as a hierarchical set of data nodes that are not tied to implementation, then it offers a great flexibility to know that every component and part in an application can use the simplest of the APIs to realize their configuration needs. Having an interface to configuration is very important as all the components of an application, including the container can use the same api.

You might parallel this to a windows Registry. It is subtly diffrent from a windows Registry. Befor going there let me say the only good thing I can say about windows Registry. Registry allowed "COM" components to succeed and florish. With out this common understanding it would have been difficult to accomplish to interoperate. Now the problem with Registry is not because it is one big blog, but because it is not an interface. Had that been an interface, application would have been able to pick and choose where to keep their own configuration without interfering with the rest. The second improvement is that this interface needs to be small.

Some of these aspects are discussed in greater detail at the following article at the following O'Reilly link

A Simplified Configuration Service

OC4J Configuration issue. /u01...dbhome_1/oc4j/j2ee/OC4J_DBConsole_orcl-db-01_orcl not found.

emctl start dbconsole 报错信息: OC4J Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/oc...
  • snowfoxmonitor
  • snowfoxmonitor
  • 2016年08月16日 20:24
  • 1353

oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_orcl not found.

想启动Oracle的OEM服务,运行emctl start dbconsole,结果出现oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_...
  • nidalaowo
  • nidalaowo
  • 2013年12月17日 18:33
  • 3877

通天塔导游:各种编程语言的优缺点

原文地址:点击打开链接
  • DQ_DM
  • DQ_DM
  • 2015年04月25日 15:49
  • 737

通天塔搜索引擎 tmd123.com 免费解锁 激活码 解锁码 永久会员

通天塔搜索引擎 tmd123.com 免费解锁 激活码 解锁码 永久会员 http://www.886404.com/tmd123_%E9%80%9A%E5%A4%A9%E5%A1%94_%...
  • qq_20328821
  • qq_20328821
  • 2014年10月22日 11:49
  • 3217

[j2ee]Apache Commons Configuration 使用

原文地址:http://blog.csdn.net/haizhilei7/article/details/6702166 项目开发过程中不免有许多在运行过程中需要经常改动的参数,比如说数据库...
  • wendellup
  • wendellup
  • 2013年01月28日 11:09
  • 1812

emctl start dbconsole报错 /oracle/11.2.0/oc4j/j2ee/OC4J_DBConsole_localhost_xxx not found

发现确实没有这个目录,这是因为当时创建的时候主机名hostname并不是localhost,而是db001.xigang。不知道为啥emctl不能找到正确的hostname了,emctl是根据什么来找...
  • smstong
  • smstong
  • 2014年09月19日 14:41
  • 3311

IntelliJ 开发j2ee项目设置

idea可以导入eclipse中的web项目,但idea默认的一些设置是和eclipse及MyEclipse是不同的,比如说MyEclipse中的web项目的资源文件夹默认为WebRoot,而idea...
  • tiantiandjava
  • tiantiandjava
  • 2016年04月07日 14:15
  • 3549

让Workshop for WebLogic 10gR3支持tomcat 6

让Workshop for WebLogic 10gR3支持tomcat 6贴几个图:      主要是修改几个地方:1、bea/workshop_10.3/workshop4WP/eclipse/p...
  • myloon
  • myloon
  • 2008年09月20日 23:54
  • 2697

常见的低效率之源—代码大全

近来在看代码大全这本书,写写摘要和读后感,希望能与看官共分享 常见的低效率之源大概有这样几个 一 输入输出操作      按照作者的话来说就是,如果你可以选择在内存中处理文件,就不要费力...
  • fly_heart_yuan
  • fly_heart_yuan
  • 2011年09月01日 23:01
  • 855

通天塔

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 要使用findView...
  • lushujuan3611
  • lushujuan3611
  • 2011年11月29日 18:04
  • 145
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Configuration,J2EE通天塔的混乱之源
举报原因:
原因补充:

(最多只允许输入30个字)