SessionEJB A talks to ADAO to access functions related to A. So A has a method a1() which in turn calls method a11() in ADAO.
SessionEJB B talks to BDAO to access functions related to B. If B needs some data that can be provided by ADAO, should it directly call a11() or should it call a1() i.e. first locate A, then call a1().
Give me your logic for and against.
posted 13 years ago
Sanz, I would have SessionEJB B call SessionEJBA method a1() (i.e. it would not call a11() directly).
Reasons are; In the future, DAO's may be replaced. This could be by using entity beans or JDO's. If SesionEJB B called the DAO directly it would have to change also. By calling SessionEJB A instead of its DAO, you are future proofing the design.