Object-relational mapping (
ORM,
O/RM, and
O/R mapping) in computer software is a technique for converting data between incompatible type systems
in object-orinted programming languages.
read more I found 2 pattern for implementing ORM, one
ActiveRecord and other is
Data Mapper +
Unit Of Work For example
php-activerecord is a open source ORM uses ActiveRecord, and
Doctrind uses Data Mapper + Unit Of Work, Doctrine is also open source.
#Doctrin IRC channel
(02:58:48 PM) msoa: In wiki quotes "Doctrine 1.x follows the active record pattern for working with data, ", my question is that in Doctrine 2 what is the pattern used?
(03:00:32 PM) ocramius: msoa: data mapper + unit of work
(03:02:59 PM) msoa: ocramius: what's "unit of work"?
(03:04:41 PM) msoa: where i can find an atricle about why Doctine leave the ActiveRecord?
(03:08:35 PM) ocramius: msoa:
http://martinfowler.com/eaaCatalog/unitOfWork.html(03:08:43 PM) ocramius: msoa:
http://martinfowler.com/eaaCatalog/dataMapper.html(03:09:31 PM) ocramius: msoa: that's basically how the JavaEE ORM works too btw. In activerecord, you tend to delegate too much responsibility to your "entity", which instead should be dumb
(03:09:41 PM) ocramius: also, you're forced to extend entities from a base record class
(03:09:53 PM) ocramius: with the data mapper, anything could be an entity
(03:14:17 PM) msoa: ocramius: Thanks a lot