WanWizard/Datamapper2 — Issue #12: Revise relationship storage
Author: WanWizard
Created: 2011-11-14 10:35:21+00:00
State: open
Labels: Feature, Pending

Currently, DataMapper stores relationship information in the configuration of the model.

This means that to find all data of a relationship, the related model must be instantiated to get access to the relationship definition from the other side.

It would be better if these would be stored in a single relationship definition "table" defining the model-pairs that make up the definition of the relation. This would mean a lot less object instantiations, and better relationship validation.

It would only be an improvement though if the model definitions are cached, otherwise the setup would always have to instantiate all related models, even if they are not referenced.