An EJB reference is a logical name used by a client (or another bean) to locate the home interface of an enterprise bean. You can define references to enterprise beans in EJB modules, J2EE application client modules, and J2EE dynamic Web modules.
It is a best practice to use an EJB reference for any enterprise bean that you need to reference. Using an EJB reference will allow you to safely write Java™ code to lookup the home interface of the target enterprise bean without the worry of the binding changing for the target enterprise bean. This is necessary if you need to install the same EJB module on the same server with different bindings.
At deployment, the EJB reference is bound to the enterprise bean's home in the target operational environment. The container makes the application's EJB references available in a JNDI naming context.
For each EJB reference that you define, an ejb-ref element is added to the deployment descriptor.
To define an EJB reference: