Originally posted by Ramesh Potti:
bcoz, by Using DAO we can use any database(Oracle,DB2) with minimal efforts.
Of course with Entiry Beans we can switch the underlying database without any code changes regardless of whether we use a DAO or not (at least, that's the theory).
Using DAOs between your application and the Entity Beans themselves makes sense, since then you can decide to stop using Entity beans and start using another ORM (or even a non-relational source) without too much of an impact on your code. However using them between Entity Beans and the RDBMS is an odd thing to do. DAO are there as an abstraction layer, pretty much in the same way that Entity beans are an abstraction layer. I don't see any benefit at all. I suppose if you are using Bean Managed Persistance you might want to abstact that persistance code in some way, but it sound like an over complication to me. It certainly is very unlikely to improve performance much anyway.
[ April 13, 2006: Message edited by: Paul Sturrock ]