六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 81|回复: 0

PEAA_学习笔记_Active Record

[复制链接]

升级  61%

251

主题

251

主题

251

主题

进士

Rank: 4

积分
805
 楼主| 发表于 2013-1-29 23:30:06 | 显示全部楼层 |阅读模式
An object that wraps a record data structure in an external resource, such as a row in a database table, and adds some domain logic to that object.

Active Record uses the most obvious approach: put data access logic into the domain object. This way all people know how to read and write their data from the database.


把各自的CRUD操作都写在Domain Object的类里面,这样做的好处是减少 Transaction Script的体积,因为 各个演员自己会做持久化,不用麻烦总导演了
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表