Enterprise JavaBeans

Enterprise JavaBeans

Enterprise JavaBeans (EJB) is a server-side distributed component model for the Java platform. EJB is a different technology from JavaBeans. Building distributed enterprise applications is difficult and introduces new challenges not present in many client-side applications. Developers need to support transactions, resource pooling, security, threading, persistence, remote access, and lifecycle issues. This results in system programming at the expense of business logic. With EJB, developers can focus on the business logic of applications without having to become specialists in system programming.

There are four parts to an EJB component:

  1. home interface - how the component is found or created

  2. remote interface - how the component is called

  3. deployment descriptor - how the component is controlled

  4. EJB class - business logic to execute

An EJB server provides the "plumbing" required to make an EJB component work, including:

  1. remote access

  2. transaction management

  3. authentication and authorization

  4. resource pooling

  5. concurrent service for multiple clients

  6. clustering and high availability

There are currently two lifecycle models defined by EJB:

  1. session EJB, based on a client session which can be either

    • stateless

    • stateful

  2. entity EJB, based on a persistent data store, which can have either

    • bean managed state

    • server managed state

Work is also underway to define a message driven EJB model for use in message-based application architectures. An example of how EJB would be used in a web-centric architecture is shown in Figure 20-3. A user would access an application is this environment through a standard web browser. The web browser might contain either plain HTML, or an applet built with JavaBeans. The web browser would communicate with a web server using the HTTP protocol. The web server would use either Java Server Pages (JSP) or Java servlets to dynamically generate HTML for the browser and then communicate with an EJB on the application server via RMI/IIOP. The EJB would then execute the business logic of the application, fetching or storing data in a back-end DBMS via JDBC.

Figure 20-3. Example EJB Architecture
graphics/20fig03.gif


Software Development. Building Reliable Systems
Software Development: Building Reliable Systems
ISBN: 0130812463
EAN: 2147483647
Year: 1998
Pages: 193
Authors: Marc Hamilton

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