coupling within ejbs

should ejbs call other ejbs or should the middle tier control all ejb communication
[97 byte] By [tman191] at [2007-9-26 12:49:06]
# 1
EJBs can certainly call other EJBs. Especially in the case of session beans, they can use a JNDI lookup to get a reference to other beans and invoke their methods. Usually however, you probably would want to avoid having entity beans make calls to other EJBs.
swatdba at 2007-7-2 12:22:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

If you look into the session facade pattern of business tier, the session ejb is used to wrap the business logic perfomed by the entity ejb's (to talk to the database). So the J2EE Patterns by itself support the coupling of EJB's as per your requirement. There are some restrictions in calling the coarse grained Entity EJB from another Entity model!

siva

siva_sub123 at 2007-7-2 12:22:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
Its rather a good practice to call an Entity Bean from a Session bean, however its better to avoid another bean call from any entity bean.
vivsrivas at 2007-7-2 12:22:21 > top of Java-index,Other Topics,Patterns & OO Design...