javaejbejb-3.0ejb-3.1

EJB Major Distinctions from other Technologies that perform the same function?


What are some major distinctions between EJB and the other technologies that perform the same function, and why is there such focus on the technologies that are, or are not supported, as opposed to other systems that refer to things such as "supporting EJB" as a feature that is either there, nor not?


Solution

  • The original concept of EJB was much closer to what are now called microservices, where the individual components could be deployed across a variety of different servers (EJB containers).

    Whereas modern microservices mostly use HTTP calls or message queues, however, EJB communication happened over a Java-specific protocol called RMI, which uses Java serialization to route method calls across the network more or less transparently. This network intermediary is the reason for needing an interface (in earlier versions of EJB, it was even more complex!): On the "local" side, the object actually behind the interface is a proxy that will serialize your method call and transmit it to wherever the EJB implementation is deployed.

    Java EE (Enterprise Edition) includes a collection of features that cover a wide variety of "enterprisey" operations, including transactions, service directories, persistence, Web (Servlets), and distributed method calls. Tomcat is calling out that while it implements the Servlet API, which is one part of Java EE, it doesn't implement all of these other components, and if you need them you'll need a different container, such as GlassFish or WildFly.