---------------------------------------------------------------------------
The details of the home and component interfaces of the bean are included in the <ejb-link> element:
Because what is given in the <ejb-link> element is what has already been given in the <ejb-name> element someware in the DD where home and component interface details have also been given in <home>, <remote> or <local-home>, <local> elements.
Then why these details are repeating again in <ejb-ref> element?
----------------------------------------------------------------------------
In order for an enterprise bean to access another bean, the bean provider declares an
EJB reference in the deployment descriptor for the home interface of the enterprise bean to be accessed. The EJB reference is given a logical name that is relative to the "java:comp/env" context. Additional information regarding the type of bean, the class names of the home and remote bean interfaces are also provided. The EJB reference in the deployment descriptor allows the application assembler and deployer to discover all references used by the enterprise bean. The deployer then binds the declared EJB reference to the enterprise bean home in the target environment. This layer of indirection allows the bean provider to look up the referenced bean's home interface using the logical name without knowing where the object resides in the enterprise system.
Shortly: <ejb-ref>tag is written by bean provider...for referencing bean1 from bean2.. He also provides the home,remote and type of bean used.So that application assembler can link the bean easily by seeing the home,remote interfaces used by bean provider.
Afterwards app.assembler or deployer links this bean2 with bean1 by providing <ejb-link> element in the deployment descriptor.
Hope this helps.