Object/Relational Mapping 数学关系 反面向对象

Posted rsapaper

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Object/Relational Mapping 数学关系 反面向对象相关的知识,希望对你有一定的参考价值。

 【hibernate ORM 是对象关系映射框架 事实上的持久化存储引擎】

http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html

Object/Relational Mapping

 

Working with both Object-Oriented software and Relational Databases can be cumbersome and time consuming. Development costs are significantly higher due to a paradigm mismatch between how data is represented in objects versus relational databases. Hibernate is an Object/Relational Mapping solution for Java environments. The term Object/Relational Mapping refers to the technique of mapping data from an object model representation to a relational data model representation (and visa versa).

【面向对象编程思想 操纵数据库】

Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. It can significantly reduce development time otherwise spent with manual data handling in SQL and JDBC. Hibernate’s design goal is to relieve the developer from 95% of common data persistence-related programming tasks by eliminating the need for manual, hand-crafted data processing using SQL and JDBC. However, unlike many other persistence solutions, Hibernate does not hide the power of SQL from you and guarantees that your investment in relational technology and knowledge is as valid as always.

Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects.

 

zh.wikipedia.org/wiki/对象关系映射

 

物件關聯對映英语:Object Relational Mapping,簡稱ORM,或O/RM,或O/R mapping),是一種程式設計技術,用於實現物件導向編程語言裡不同類型系統的資料之間的轉換。從效果上說,它其實是創建了一個可在編程語言裡使用的“虛擬物件資料庫”。如今已有很多免費和付費的ORM產品,而有些程式設計師更傾向於建立自己的ORM工具。

 

【源自数学的关系 是 反 面向对象的】

物件導向是從軟體工程基本原則(如耦合、聚合、封裝)的基礎上發展起來的,而關聯式資料庫則是從數學理論發展而來的,兩套理論存在顯著的區別。為了解決這個不匹配的現象,物件關聯對映技術應運而生。

簡單的說:ORM相當於中繼資料。具體到產品上,例如下邊的ADO.NET Entity Framework。DLINQ中實體類的屬性[Table]就算是一種中繼資料。

物件關聯對映成功運用在不同的物件導向持久層產品中,如:TorqueOJBHibernateTopLinkCastor JDOTJDOActive RecordNHibernateADO.NET Entity Framework 等。

 

 

 

以上是关于Object/Relational Mapping 数学关系 反面向对象的主要内容,如果未能解决你的问题,请参考以下文章

Object Relational Mapping(ORM)

ORM(Object Relational Mapping)

python—day60 Object Relational Mapping(ORM) ORM连表查询 ORM进阶

django关系对象映射(Object Relational Mapping,简称ORM)

ORM(Object Relational Mapping:对象关系映射)

一:ORM关系对象映射(Object Relational Mapping,简称ORM)