Remote and local interfaces: comparison

Figure 2-26 compares remote and local interfaces.

Figure 2-26. Comparison between remote and local interfaces

We have discussed all the boxes in Figure 2-26 except the last. With local interfaces, the code to access the EJBHome is simplified through the use of a class cast operation (Figure 2-27).

Figure 2-27. Client lookup of local home interface
InitialContext ctx = new InitialContext();
Object objHome = ctx.lookup("java:comp/env/ejb/itso/MyCustomer");
CustomerLocalHome home = (CustomerLocalHome)(objHome);

Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.