Are you saying that apart from using SLSB as a facade to entity beans, that if you use a SLSB to access data via a DAO then you would still use a SLSB to perform CRUD operations ? and thus do away with an entity bean altogether ?
Yes, I am hinting that you could have an architecture that does not use entity beans, but uses SB with DAO. Understand that entity beans are more expensive than session beans because they are burdened with keeping their data upto-date and hence results in multiple database roundtrips under the hood.
The only thing you give up by not using entity beans is caching. Most of the app server vendors implement smart caching aimed to reduce database round trips. Other than this one feature, EB ans SB both offer transactions, distribution, location transparency, concurrency management, JNDI lookup etc. Of course, entity bean may make your life easier(
) if you used CMP/CMR for advanced object-to-relational mapping. So that may be another deciding factor - do you need an advanced persistence framework or are you willing to write one yourself? If you need one, is entity beans your answer or are you willing to consider other emerging persistence frameworks such as JDO, Hybernate, Apache OJB etc..
Whats wrong with having a SLSB that has a local interface to an ENTITY bean that performs the CRUD operations ? Or is the ENTITY bean not really required in this instance ? (i.e, just do the CRUD operations inside the SLSB)
There is nothing wrong. You first have to decide whether you
want to use entity beans. If so, it is always best to model them as local beans and have only a few remote session beans that are visible to the client.
Cheers,