9.1 Introduction


The Enterprise JavaBeans specification [1] defines EJB as "a component architecture for the development and deployment of component-based distributed business applications. Enterprise beans are components of distributed transaction-oriented enterprise applications. Applications written using the Enterprise JavaBeans architecture are scalable, transactional, and multi- user secure. These applications may be written once, and then deployed on any server platform that supports the Enterprise JavaBeans specification."

[1] http://java.sun.com/products/ejb

In practice, this translates into a number of concrete features:

  • Transaction management (declarative or explicit via code, possibly distributed)

  • Contracts (components, remote and local clients ) and Views (including Web services)

  • Simple security management (declarative or explicit)

  • Instance and resource pooling

  • Exception handling (standard conventions)

  • Deployment (packaging, descriptors)

  • Management (runtime monitoring)

Enterprise Java Beans are but one type of component in the bigger J2EE architecture picture of things. Figure 9-1 illustrates the relationship to other components, such as in the Web tier .

Figure 9-1. EJBs as server-side business logic in the classical J2EE Architecture.

graphics/09fig01.jpg

There are currently three types of enterprise beans that model typical but fairly different and technically relatively unrelated requirements of modern enterprise software, see also Figure 9-2:

  • Session beans: These are components that represent stateless services that are invoked synchronously from remote clients. They are possibly accessible as Web-service endpoint views. A stateful variation models components that represent a conversational session with a particular client. Session beans are accessible with remote invocation or via local interfaces.

  • Message-driven beans: These are components that represent a stateless service and whose invocation is asynchronous, usually driven by the arrival of Java Messaging Service (JMS) messages.

  • Entity beans: These are components that represent persistent objects. Entity beans are also accessible with remote invocation or via local interfaces. Note that entity beans are technically unrelated to JDO and predate it; more on this later.

Figure 9-2. Types of EJB components.

graphics/09fig02.gif

Of these three types, one is related to persistence and thus overlaps with JDO. The other two types of EJBs represent service-oriented interfaces that, in order to do their tasks , often rely on and thus interface with a persistence API, such as JDBC, entity beans, JDO, or others. The point to remember is that these three enterprise bean types do not depend on each other in any way, but offer different features. We look at the role of JDO with each throughout this chapter.



Core Java Data Objects
Core Java Data Objects
ISBN: 0131407317
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net