O'Reilly logo

Head First EJB by Bert Bates, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Who creates what?

For a bean with a remote client view (in other words, a bean that can be accessed by remote clients), you know that you have to write the Component interface and the Bean class. But somebody has to write the class that implements your Component interface (to make the Remote EJBObject), and somebody has to make the stub that goes with that EJBObject. That somebody is the Container. And, though we haven’t yet talked about the Home, we’ve listed the relevant pieces here for completeness.

You

the Container

  1. The Component interface (extends javax.ejb.EJBObject)

  2. The Bean class (implements javax.ejb.SessionBean or javax.ejb.EntityBean)

  3. The Home interface (extends javax.ejb.EJBHome; we’ll talk about this on the next page)

  1. The EJBObject class (implements your Component interface)

  2. The EJBObject stub class (implements your Component interface and knows how to talk to the EJBObject)

  3. The Home class (implements your Home interface)

  4. The Home stub class (implements your Home interface and knows how to talk to the Home)

image with no caption

We haven’t talked about the Home yet, so we don’t show it on this picture.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required