Originally posted by Muhammad Asif:
Joseph,
By DAO i mean a dataaccess object, containing data access logic. So if i write a DAO, it obviously means i shouldn't write a CMP or BMP ? or can i mix and match ? What are the pros and cons in doing this ?
BMPs are generally realized by using DAOs...
you may mix and match, but you have to justify....
basically, with dao the developer has the full control of the database access layer. It is sometimes not an design issue. Nowadays, most ejb container do generate reasonably efficient database access logic for CMPs, but still it may be less efficient than those writen by a
JDBC guru....
And also CMP provides a layer of caching, therefore, for those frequently accessed/quried/updated objects, CMP may be a good choice. on the other hand, BMP or SLSB+DAO may be just enough for one time data insertion, also equiped with CMT.