Project

General

Profile

Actions

Improvement #159

closed

Add validations for self-related associations

Added by liaham about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02/12/2021
Due date:
% Done:

100%

Estimated time:
Compatible Redmine Version:

Description

Self-related Relation

A relation between two objects of the same model (ProjectType or Project) is defined as ordered pair:

(a,b) != (b,a)

The left object of the pair is the superordinate (guest) and the right object is the subordinate (host).

  • Project types uses superordinate and subordinate notation.
  • Projects uses guest and host notation.

Resulting Rules concerning Data Persistence

  1. An object cannot have a relation to itself: (a,a) or (b,b) .
  2. An oject cannot have a subordinated relation to its superordinated object, what would cause a circular reference: (a,b) and (b,a) . That is, a relation is either (a,b) or (b,a), but not both. The preferred definition, what should be saved, is from superordinated object to subordinated object.
  3. The pair (a,b) is uniqe.
Actions

Also available in: Atom PDF