Currently I am developing a application using BMP.
I have a question here. When should I use Session EJB to call Entity EJB ? When should I use Session EJB to call DAO directly?
I set a few guideline on the question above.
I will use Session EJB to call Entity EJB when
1. Insert, Update, Remove a record
2. Select a record from a table
I will use Session EJB to call DAO when
1. Insert, Update, Remove >1 records
2. Select >1 records from a table
3. Select a record from >1 table
I follow this guideline because bulk access through DAO is faster than going through Entity EJB.
But I was wondering whether this is a good design? Or is there any other better way?
In fact, it come to a question that why we need Entity EJB? Because I can access everything through DAO !