> Le 8 févr. 2019 à 19:50, Ed Hammond via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> Have any of you come up with a convention for naming relations for use with 
> ORDA? What have you found that works? or doesn't?

Hi Ed, 
the relation name is the direction in which we go from one field to another. 
Thus I stick to my table and fields naming to identify in the relation name:
- the destination table
- the direction (many to one ≠ one to many)
The "from" is unnecessary (redundant) because ORDA starts with it:

For example:
  [company]PK ............ primary key
  [employee]FK_company ... foreign key
  company_p .............. relation to one   {from ds.employee}
  employee_f ............. relation to many  {from ds.company}

ORDA will be like this:
  ds.employee.company_p … (many to one, to Primary…)
  ds.company.employee_f … (one to many, to Foreign…)

BTW, in french, "p" stands for "père" (father) an "f" for "fils" (sons), it 
suits me. Maybe an english reader would prefer O, M, for one, many, use a 
prefix instead. Some like plural/singular I've seen, like "company" and 
"allEmployees". Too much grammar for me  ;-) 

As two fields in the same table can't have the same name, two properties in the 
same entity must have different names. In case of multiple relation, I still 
follow my foreign keys naming, I add to the names what makes them different. 
For example this table:
  from PK to FK_humanFather: humanFather_f
  from PK to FK_humanMother: humanMother_f
  from FK_humanFather to PK: human_p, father_p, etc.
  from FK_humanMother to PK: human_p, mother_p, etc.

Arnaud de Montard 

4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com

Reply via email to