links / relations

A Link “joins” two nodes together defining roles for these nodes through the Relation. Some relations are many-to-many, some are many-to-one and some are one-to-one. Depending on the relation type, “joining” two nodes can suppress or update a previous link:

When updating link B (change source), link A is destroyed since there can be only one icon for a node.
features
What do we need from the new rewrite of links/relations ?
- dynamic methods for nodes (icon_id=, icon_status=, icon_for_ids=, ...).
- check drive/write rights on source/target(s).
- loading of link_id in nodes (used by ‘unlink’).
who does what
The current implementation of links (July 2008) is a total mess because it is not clear which part does the job. In the beginning, the creation/update of links was done through the node itself, after save. The trigger for update should still be there most of the time but the part that really has all the knowledge to do things properly is the Relation proxy, a Relation that is aware of the context (has a start node).

comments
Implementation finished ! (ticket)