, " 1 n".
"1" , "n" (). , . , , // , . , , // .
, , , :
:
- ? IdentityMap? ?
- , , ? , , ?
- ?
, ORM- .
, IdentityMap , , - . "". , .
, " " . ORM ++: YB.ORM. , DataObject.h, DataObject.cpp TestDataObject.cpp( lib/orm/).
YB.ORM "" , .
DataObject , . . . . , ( : New, Ghost, Dirty, Sync, ToBeDeleted, Deleted) . , "n" , RelationObject (slave_relations_ member). , "1" , RelationObject (member_relations_ member).
A class RelationObjectis an instance of a relationship. Such objects are always allocated on the heap and are not copied. They store and list pointers to related instances DataObject: one pointer to master and a set of shared pointers to slaves. Thus, they "own" subordinate instances DataObject, and instances DataObject"own" (indirectly) all subordinate objects. Note that it RelationObjectitself supports something like state to support lazy loading.
source
share