Application Architecture

Note: The above figure shows the application architecture using hibernate. A application consist of user interface layer, Application interface layer, DAO layer that manage the connection with the data source to obtain and store data. DAO use hibernate to connect with the database that covert into JDBC internally, then JDBC connect the application to the database.
DAO [Data Access Object]
- Use DAO to separate Object-Relationship behavior from the rest of your project as it provide high level of data source abstraction.
- The DAO manages the connection with the data source to obtain and store data, data could be a persistence object.
- DAO make application data source independent that is DAO hides the underlying data source implementation from its clients.
- DAO interface to clients doesn't change when the underlying data source implementation changes.
Note: The above classes has redundant code to perform CRUD operation into database. To fix this situation the concept of AbstractDAO comes in picture.

AbstractDAO
AbstractDAO is a super class of all other DAO that contains methods for CRUD operation, which are common to all sub DAO that is all DAO need these method to perform CRUD operation into database, So to remove redundant data from the code abstarctDAO is created this pattern is calledSuperclass pattern.

