CORBA Vs EJB
WHY SHOULD I USE CORBA AND NOT EJB?
Enterprise Java Beans (EJB) is a new distributed object computing technology. Being new, EJB simultaneously offers appeal (it is new!) and risk (it is new!). EJB does not have the broad installed base like CORBA, nor does it have all of the services. But, undoubtedly, over time, EJB deployments and services will grow. The main distinctions between EJB and CORBA are on flexibility and focus:
- CORBA is language and platform neutral whereas EJB is Java and JVM specific.
- CORBA’s POA/Servant model is more flexible than the EJB Container/Bean model.
- EJB tends to better support the deployment environment with the strong notion of configuration. While CORBA does not say much about configuration, some ORB products are particularly strong in this area.
The CORBA and EJB environments can naturally interoperate at the network level. Core Java and EJB distributed computing uses Java Remote Method Invocation (RMI) for the network protocol. CORBA’s IIOP and Java’s RMI are compatiable in the sense that IIOP can carry RMI-based calls.
MUST I CHOOSE BETWEEN EJB AND CORBA?
No. Distributed applications can be developed using both CORBA and EJB. For example, a client application might be developed to access a set of EJB and CORBA objects without distinction. There are some differences in the interface design patterns in the two environments, but there are straightforward to handle.
IS CORBA MORE MATURE THAN EJB?
Yes. EJB was developed relatively recently, well after CORBA had been through its early adoption pains. This gives CORBA a longer track record of successful and unsuccessful system installations. This, however, gives EJB the benefit of handsight. We have said that “EJB is CORBA combined with some best practices”. This is meant to indicate
- At a high-level, EJB and CORBA are more similar than different.
- The difficult architectural problems of distributed computing are still difficult, regardless of which technology is used. These problems reflect more on determining how the system should represent interfaces rather than how to act on those interfaces.
- EJB provides some clarifying concepts. For example having two interface keywords, SessionBean and EntityBean, to indicate the conversational or non-conversational semantics of an object is useful. The same thing can be done with CORBA’s single style of interface, and most real CORBA systems distinguish between conversational and non-conversational interfaces.