one of the goals of enterprise javabeans is to make it easy to write applications. application developers wont have to understand low-level transaction and state management details, multithreading, resource pooling and other complex low-level apis. in the nominal case this extrapolation of the complexities of building large, complex distributed applications has been accomplished well. it doesnt take much more effort to implement an interface to a database table object using ejb than it does to implement it locally. if the ejb object is deployed using a high-end ejb server, the object can be replicated among multiple machines, providing load balancing and fault tolerance with little or no effort on the bean developers part.
the model that ejb is predicated on, transaction-based processing, works well in many circumstances, the most prominent being client/server and n-tiered systems in which the server layer manages some form of persistent store. a number of other distributed application needs, however, dont fit as well into the ejb model. one of them is event-based processing.
ejb still provides many benefits to applications that dont directly match the transaction-based ejb model. it just takes a bit more understanding of what ejb provides for you and what you have to do to get it to work. event processing happens to be an application that begs for a middleware server but doesnt fall into the transactional model.
events happen on a regular basis in our daily lives. we get up, go to work and so on. the same can be said of our software - events happen regularly in our software systems. the user logs into the application, requests a new clients data, etc. some events, such as handling an order, are handled in the regular course of processing; others, such as an i/o failure, are considered exceptional processing.
in large distributed systems a frequent problem is that events often need to be processed by a component that resides far from the component that detected the event. maybe the middle tier detected that the logon attempt failed, but a logging component on the server needs to know about this failure. on the ot... 下一页