EXACTLY! :-D I think Paul and I mis-communicated on the point of the iBATIS DAO earlier.
It is something very different from iBATIS SQL Maps. One of the key principles of Object-Oriented programming is encapsulation – the separation of an implementation and its public interface. The DAO pattern is one more tool that allows you to do that in your applications. By separating the data access details from the data access API, we are able to provide a homogeneous set of interfaces over heterogeneous data access mechanisms. An application can access data from multiple databases, each with a different underlying API using a single consistent data access API. Interestingly, the JDBC API is another application of the DAO pattern. In that realm, you have a set of interfaces, and database vendors implement them in a way that makes it possible to use them interchangeably – for the most part. In a few cases, where vendors feel that the interfaces do not provide the capability to do things that they want to do, they work outside the interface. This pattern is one of the things that make tools like iBATIS SQL maps and Hibernate possible. Because nearly all database vendors implement the JDBC APIs reasonably accurately, tools can be written that operate against those interfaces instead of the underlying implementations, and for the most part, those tools will work with any vendor's implementation. This is one of the goals of the iBATIS DAO – to help you provide a set of interfaces to your applications that hide the underlying implementation of the data access. So, if you have a Hibernate based application that uses the DAO pattern, you can replace that with a SQL Map based implementation, or a JDBC based implementation without having to rewrite the entire application. Instead, all that needs to be changed is the implementations of the interfaces that the application is using. As long as the DAO interface is implemented correctly, the application will continue to function as expected. Larry On 8/24/05, Emmanouil Batsis <[EMAIL PROTECTED]> wrote: > Larry Meadors wrote: > > >You can (and should) use the DAO pattern with Hibernate, too. > > > > So true, plus a good DAO interface can decouple your database access > implementation and the rest of your app, so that you can switch from > hibernate to ibatis or plain jdbc or whatever without having to make > code changes to anything that uses DB connectivity. > > M > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >