Enterprise JavaBeans Architecture
EJB components are similar to servlets/JSP pages in that remote access is built-in. You don’t need to write any remote infrastructure to implement multitier architecture designs. Declaring a bean to be remote generates all of the code required to make the bean run remotely. Just as the HTTP protocol mediates remote access for web-based clients, the SOAP and/or RMI/IIOP protocols enable remote access for EJB components. Using standard remote protocols allows you to focus development on the application logic instead of protocol-handling.
But there are two significant differences between servlets/JSP pages and EJB components.
First, declarative transactions and distributed transactions are built into EJB components. As an application developer, you don’t need to code transactions explicitly into your application logic. Transactions are applied to applications declaratively, not embedded into code. During application assembly, the assembler specifies the transaction attributes of each method. Assembly combines application components into larger applications and preserves transaction semantics. Distributed transactions (transactions that include multiple resource manager s) are handled for your application as transparently as local transactions (those that involve only one resource manager).
Second, security is built into EJB components. You don’t need to write security protocols or worry about credentials. Methods and resources are declared to require ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access