It all starts with the home interface

The client wants the bean. Well, too bad. The client will never get the bean, because nobody talks to the bean (except the container). The best the client can hope for is a reference to the bean’s bodyguard—the component interface. And the client gets a reference to the bean’s component interface by calling a method on the bean’s home interface.

image with no caption

What the client REALLY wants is a reference to the bean. But the best the client can do is get a reference to the bean’s component interface--the EJB object[6].

But if she wants an EJB object reference, the client has to get a reference to the bean’s home interface.

So that’s where it begins... the client does a lookup on the bean’s home.

Get Head First EJB 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.