[GOODIE] BinaryRelation
Avi Bryant
avi at beta4.com
Fri Mar 28 05:08:37 UTC 2003
On Fri, 28 Mar 2003, Richard A. O'Keefe wrote:
> My guess was that this would -not- be so; if someone is happy with one-way
> navigation, there are simpler ways than BinaryRelation to get there.
I'm going from experience with object/relational mapping, where you
usually have two related types each wanting to navigate to the other. To
take your child/caregiver example from earlier, it seems like the most
common uses would be Child>>caregivers and Caregiver>>children - both of
which only navigate in one direction:
caregivers
^ childrenToCaregivers at: self
children
^ caregiversToChildren at: self
Of course at that point you may want to have a further layer of wrapper
objects which further curry things, as it were, down to a single
Set-look-alike, and your child and caregiver objects would hold those
directly.
Perhaps I'm missing what you're trying to do with this, but it seems like
a large segment of users would care very much about maintaining
referential integrity across the entire relation (if you send
Child>>addCaregiver: then that had better affect a later call to
#children), but much less about using the whole relation at once.
$0.02 CDN
Avi
More information about the Squeak-dev
mailing list
|