Data Access Object
Data Access Object(DAO)とは、ある種のデータベースや永続性機構の抽象化されたインタフェースを提供するオブジェクト�…
Data Access Object(DAO)とは、ある種のデータベースや永続性機構の抽象化されたインタフェースを提供するオブジェクトであり、データベースの詳細を開示することなく特定の操作を提供する。
なお、マイクロソフトのライブラリであるData Access Objectsとは直接の関係はない。
概要
Data Access Objectは問題を、ドメイン固有のオブジェクトとデータ型を使ってアプリケーションにどのようなデータアクセスが必要であるかという点(DAOの公開インタフェース)と、それらのニーズを特定のDBMSやデータベーススキーマでどのように満足するかという点(DAOの実装)に分離する。
このデザインパターンは多くのプログラミング言語で利用可能であり、多くの永続性を必要とするアプリケーションや多くのデータベースで利用可能である。しかし、サン・マイクロシステムズのベストプラクティスガイドライン[1] ("Core J2EE Patterns") が発祥であるため、JDBC APIを経由してJakarta EEから関係データベースにアクセスする際に適用されることが多い。
利点
DAOを利用する際の利点は、アプリケーションの重要な2つの部分間の比較的単純で厳密な分離を可能にする点であり、それによって各部が互いのことをほとんど知らなくて済むようにし、独立に修正可能となる。ビジネスロジックの変化は、インタフェースが正しく実装される限り、DAOクライアントに影響しない。
Javaに関しては、Data Access Objectは数々の複雑で多様なJava 永続性技術(JDBC、JDO、EJB CMP、TopLink、Hibernate、iBATISなど)からアプリケーション本体を隔離するのに利用される。Data Access Objectを使うと、基盤となる技術を更新/置換しても、アプリケーションの他の部分を変更する必要がない。
脚注
注釈
出典
- ^ “Core J2EE Patterns - Data Access Object”. Sun Microsystems Inc. (2002年). 2007年8月2日閲覧。
関連項目
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.