問題描述
能否請你解釋一下以下數據庫代表之間的區別,比如在 PHP 中.
ORM道數據映射器活動記錄表格網關
如有任何示例,我們將不勝感激.
這需要一個很長的答案.我沒有在我面前重復別人說得更好更詳細的內容,而是將您鏈接到一些相關頁面.我建議仔細查看它們.也許遵循一些額外的鏈接.維基百科總是一個好的開始.如果您在瀏覽鏈接后仍然對一種或另一種模式有任何疑問,請隨時返回 SO 并再次提問.但是,如果您這樣做了,請嘗試縮小范圍.提出多個問題并專注于特定方面比期望人們為您寫文章要好.
對象關系映射器
<塊引用>計算機軟件中的對象關系映射(ORM、O/RM 和 O/R 映射)是一種編程技術,用于在關系數據庫和面向對象的編程語言中不兼容的類型系統之間轉換數據.
數據訪問對象><塊引用>
使用數據訪問對象 (DAO) 來抽象和封裝對數據源的所有訪問.DAO 管理與數據源的連接以獲取和存儲數據.
DataMapper
<塊引用>一層映射器 (473),用于在對象和數據庫之間移動數據,同時保持它們彼此獨立以及映射器本身.
活動記錄
<塊引用>在數據庫表或視圖中包裝一行、封裝數據庫訪問并在該數據上添加域邏輯的對象.
表數據網關
<塊引用>充當數據庫表網關 (466) 的對象.一個實例處理表中的所有行.
Can you, please, explain me the differences between the following database representatives, say, in PHP.:
ORM DAO DataMapper ActiveRecord TableGateway
Any examples would be appreciated.
That would require a pretty long answer. Instead of repeating what others have said better and in more detail before me, I link you to some relevant pages. I suggest to look through them. Maybe follow a few additional links. Wikipedia is always a good start. If you still have any questions about one or the other pattern after going through the links, feel free to come back to SO and ask again. But if you do, try to narrow it down. It's better to ask multiple questions and focus on particular aspects than expecting people to write an essay for you.
Object Relational Mapper
Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages.
Data Access Object
Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.
DataMapper
A layer of Mappers (473) that moves data between objects and a database while keeping them independent of each other and the mapper itself.
Active Record
An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
Table Data Gateway
An object that acts as a Gateway (466) to a database table. One instance handles all the rows in the table.
這篇關于ORM/DAO/DataMapper/ActiveRecord/TableGateway 的區別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!