Configuration,J2EE通天塔的混乱之源

系统 1927 0

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



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=2434


Configuration,J2EE通天塔的混乱之源


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论