Jan'uary » 日志 » Polymorphic Association
Polymorphic Association
Jan 发表于 2008-05-13 16:12:00
"The polymorphic association, on the other hand, while it bears some resemblance to the regular polymorphic union of a class hierarchy, its not really the same since you're only dealing with a particular association to a single target class from any number of source classes, source classes which don't have anything else to do with each other; i.e. they aren't in any particular inheritance relationship and probably are all persisted in completely different tables. In this way, the polymorphic association has a lot less to do with object inheritance and a lot more to do with aspect oriented programming (AOP); a particular concept needs to be applied to a divergent set of entities which otherwise are not directly related. Such a concept is referred to as a cross cutting concern, such as, all the entities in your domain need to support a history log of all changes to a common logging table. In the AR example, an Order and a User object are illustrated to both require links to an Address object."
http://techspot.zzzeek.org/?p=13
http://techspot.zzzeek.org/?p=13
曾经的这一天...
- » 2006年: 字号Jan 海带花生排骨汤
- » 2005年: 不需要显卡也能够启动
- » 2005年: So... why choose Open Source?
相关日志:
收藏:
QQ书签
del.icio.us
订阅:
Google
抓虾
