Componentization

About SOA and CBD

Advantages

Platforms

Our Approach

White Paper and Specifications

CBD Resources

About us

Contact us


Enterprise JavaBeansTM 2.0 Specification

(Text Source:http://java.sun.com)

Local Interfaces -- Streamlining Calls Between Local Beans


EJB was originally designed around remote invocation using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing applications without consideration for the deployment scenario, and was a strong feature in support of a goal of component reuse in J2EE. We received a good deal of community input regarding the way EJBs are used in the field. Many developers are using EJBs locally -- that is, some or all of their EJB calls are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a local interface mechanism. The local interface may be defined for a bean during development, to allow streamlined calls to the bean if a caller is in the same container. This facility will thus improve the performance of applications in which co-location is planned. EJB 2.0 local interfaces can be very useful in the situations for which they were designed. However, it is important to understand that the calling semantics of local interfaces are different from those of remote interfaces. For example, remote interfaces pass parameters using call-by-value semantics, while local interfaces use call-by-reference. This means that in order to use local interfaces safely, application developers need to carefully consider potential deployment scenarios up front, then decide which interfaces can be local and which remote, and finally, develop the application code with these choices in mind. While EJB 2.0 local interfaces are extremely useful in some situations, the long-term costs of these choices, especially when changing requirements and component reuse are taken into account, need to be factored into the design decision.

 


© 1999-2009 WebCab Components. All rights reserved.