Early binding of referenced objects #41

Closed
hisystems opened this Issue Mar 25, 2012 · 1 comment

Comments

Projects
None yet
1 participant
Owner

hisystems commented Mar 25, 2012

Currently, late binding of referenced objects is supported via the ObjectReference class. This is assigned the foreign table's distinct field when the referencing object is loaded. On the first call to ObjectReference.Object the object is loaded and on subsequent calls the already loaded object is returned. Early binding of objects is supported via the IDatabaseObjects.TableJoins function which causes the database record and the referenced record to be loaded into one record. This record is then used to load the object and the referenced object in one operation rather than via multiple calls to the database. However, this requires overriding the IDatabaseObject.LoadFields function and using the Database.ObjectLoad, which is not a particularly succinct solution.

hisystems was assigned Mar 25, 2012

Owner

hisystems commented Mar 25, 2012

Utilise the existing ObjectReference class but specify an attribute that indicates whether early or late binding should be utilised: ObjectReferenceLoadAttribute(Early / Late). When an object is using early binding the appropriate table joins should be automatically created and the referenced object loaded and assigned to the ObjectReference.Object property.

hisystems closed this in ea8b776 Apr 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment