当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: This is the first in a two-part
 

 

    摘要:henry ford revolutionized manufacturing with the first automated assembly line in 1913, incorporating the latest time-study theories to make model ts flow through the system "like the flow of wat......
 ·practical layout managers @ jdj    »显示摘要«
    摘要: this article tries to take the mystery out of the black art of developing layout managers. much of the coverage in books and magazines typically centers on trying to wrench the complicated gridbagl......


EVENT Management & Enterprise JavaBeans @ JDJ
上一页   ...her hand, the component that detected the problem shouldnt need to know what components are interested in this specific event. for distributed applications the event distributor needs to handle both the receiving and the transmitting of events to remote components.

in reviewing the strengths and weaknesses of ejb and how they fit in an event distribution subsystem, we can determine the following:

ejb doesnt provide a mechanism for the event distribution system to inform the remote components that an event has occurred (no callback mechanism). 【程序编程相关:java tips

ejb allows remote components to send events to the event distribution system. 【推荐阅读:字节码如何防止内存错误及提高代码质量

ejbs transactional model doesnt help us in the event distribution subsystem, since events are not transactional in nature.

this article and its sequel will show you one possible way to handle these vast requirements in a simple, straightforward framework so that your application will be able to handle events as easily as it handles normal, transaction-oriented, multitiered processing.

what is an event, anyway? 【扩展信息:java程序编码规范

the ejb server provides all the features required for a highly scalable, fault-tolerant, load-balanced application.

in most java development circles, when event handling is discussed its normally in association with the awt event model. in the awt model the component interested in the event (consumer) simply registers with the producer of events (producer). the producer then iterates its list of interested parties (consumers), sending the event to all who have registered with it. this is a classic implementation of the observer pattern, and it works well in an application that runs in a single vm.

when an application begins to span multiple vms, and components are created on the fly without notification to other components, the awt model of tight coupling between the consumer of events and the producer of events gets to be unworkable. how does the consumer know that a producer of events has started on a machine somewhere else on the network?

consumers of events dont care who generated the event, just that the event occurred. if a database is out of space, the event consumer doesnt care what process detected that the database needs more disk space. it just knows that its job is to notify the administrator of this fact. conversely, the event producer doesnt care who needs the event, or what theyre going to do with it, just that the event was detected and that consumers may be interested in it.

the mediator pattern can be used to allev
...   下一页

    摘要:revious articles in this series discussed ways of making development of web services more efficient and the applications themselves highly manageable once deployed. but there is more that developers c......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE