Data Access Object - Advantages

Advantages

The advantage of using data access objects is the relatively simple and rigorous separation between two important parts of an application that can and should know almost nothing of each other, and which can be expected to evolve frequently and independently. Changing business logic can rely on the same DAO interface, while changes to persistence logic do not affect DAO clients as long as the interface remains correctly implemented.

  • can be used in a large percentage of applications - anywhere data storage is required.
  • hide all details of data storage from the rest of the application.
  • act as an intermediary between the application and the database. They move data back and forth between objects and database records.
  • allow ripple effects from possible changes to the persistence mechanism to be confined to a specific area.

In the specific context of the Java programming language, Data Access Objects as a design concept can be implemented in a number of ways. This can range from a fairly simple interface that separates the data access parts from the application logic, to frameworks and commercial products. DAO coding paradigms can require some skill. Use of technologies like Java persistence technologies and JDO ensures to some extent that the design pattern is implemented. Technologies like Enterprise JavaBeans come built into application servers and can be used in applications that use a JEE application server. Commercial products like TopLink are available based on Object-relational mapping (ORM). Popular open source ORM products include Doctrine, Hibernate, iBATIS and Apache OpenJPA.

The expected benefit of use of Data Access Objects in a Java scenario is:

  • Improved efficiency and performance of the data layer since it is standard reusable software.
  • Modifications can be made to the DAO implementation without altering other decoupled modules of the application.

Read more about this topic:  Data Access Object

Famous quotes containing the word advantages:

    If we live in the Nineteenth Century, why should we not enjoy the advantages which the Nineteenth Century offers? Why should our life be in any respect provincial?
    Henry David Thoreau (1817–1862)

    When the manipulations of childhood are a little larceny, they may grow and change with the child into qualities useful and admire in the grown-up world. When they are the futile struggle for love and concern and protection, they may become the warped and ruthless machinations of adults who seek in the advantages of power what they could never win as children.
    Leontine Young (20th century)

    There are great advantages to seeing yourself as an accident created by amateur parents as they practiced. You then have been left in an imperfect state and the rest is up to you. Only the most pitifully inept child requires perfection from parents.
    Frank Pittman (20th century)