Client applications do not interact with an enterprise bean directly. Instead, the client interacts with the enterprise bean through two intermediate objects that are created by the container from classes generated by a deployment tool—one of which classes implements the EJB home interface and the other the EJB component interface. As the client invokes operations using these intermediate objects, the container intercepts each method call and inserts the management services.
When a bean is deployed in an EJB server, the container registers the home interface in a namespace that is accessible remotely. Using the Java Naming and Directory Interface (JNDI) API, any client with access to the namespace can locate the home interface by name. (To be precise, the client locates, by name, an object that implements the home interface. The home interface extends the EJBHome interface.)
When a client creates or finds an instance of an enterprise bean, the container returns a component interface object (one per instance). (To be precise, the container returns a reference to an instance of a class that implements the component interface. The component interface extends the EJBObject interface.)