Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-09 Thread Arnaud de Montard via 4D_Tech

> Le 9 févr. 2019 à 15:31, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I always use singular table names and the relationship names are singular or 
> plural based on their type. [...]

Hi, 
using grammatical rules makes reading code closer to human langage. But I 
prefer to have the target table name in the relation name, as Christian said it 
allows generic treatments:
- in french many names have the same singular and plural (mouse -> 
souris/souris, contest -> concours/concours)
- in english it seems easier but there are many plurals that will not allow to 
get the table easily (tooth/teeth, story/stories, fish/fishes) 

-- 
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
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-09 Thread John DeSoi via 4D_Tech
I always use singular table names and the relationship names are singular or 
plural based on their type. For example, I have a structure that imports 4D 
code and builds a database of each method path and the related methods it 
directly calls:

[Method_Call]ID

[Method_Call]Caller_Method_ID -> [Method]ID
M to 1: Caller
1 to M: Method_Callers

[Method_Call]Callee_Method_ID -> [Method]ID
M to 1: Callee
1 to M: Method_Callees

John DeSoi, Ph.D.



> On Feb 8, 2019, at 12:50 PM, Ed Hammond via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hey all of you ORDA pioneers and converts!
> 
> 
> 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?

**
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
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Arnaud de Montard via 4D_Tech

> Le 8 févr. 2019 à 20:18, Christian Sakowski via 4D_Tech 
> <4d_tech@lists.4d.com> a écrit :
> 
>> I went much simpler…
> 
> This is quite the same, but the problem with this approach is, that i cannot 
> parse relations generically.

I do agree, a name that allows to identify the function is great:
  find regex("^FK_";property;1) -> foreign key
  find regex("_p$";property;1) -> many to one relation
And these names are not supposed to change every day…  

-- 
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
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Arnaud de Montard via 4D_Tech

> 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:
  ds.dataclass.{property}

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:
  [Human]
   PK
   FK_humanFather
   FK_humanMother
Relations:
  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
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Christian Sakowski via 4D_Tech
> I went much simpler…

This is quite the same, but the problem with this approach is, that i cannot 
parse relations generically.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 08.02.2019 um 20:15 schrieb Neil Dennis :
> 
> Given two tables:
> 
> [Invoice]
> [InvoiceItems]
> 
> 
> I went much simpler…
> 
> The many to one from InvoiceItems to Invoice I simply name invoice
> The one to many from Invoice to Invoice Items I simply named invoiceItems
> 
> Then the dot notation comes out to be
> 
> Invoice.invoiceItems
> InvoiceItems.invoice
> 
> 
> 
> 
> Neil
> 
> 
> 
> 
> 
> 


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
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
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Neil Dennis via 4D_Tech
Given two tables:

[Invoice]
[InvoiceItems]


I went much simpler…

The many to one from InvoiceItems to Invoice I simply name invoice
The one to many from Invoice to Invoice Items I simply named invoiceItems

Then the dot notation comes out to be

Invoice.invoiceItems
InvoiceItems.invoice




Neil






**
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
**

Re: Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Christian Sakowski via 4D_Tech
Yes, since years i use the following:

Given two tables:

[Invoice]
[InvoiceItems]

The id from the invoice is named as:

[InvoiceItems]_Invoice__

(one leading underscore and double underscore as postfix)

For ORDA i name the relation:

[InvoiceItems]_Invoice__MO

(MO means Many to One) which is an entity and

[Invoice]_InvoiceItems__OM

(One to Many) which is an entitySelection
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
christian.sakow...@heubach-media.de
Tel: +49/(0)40/52 10 59-23




> Am 08.02.2019 um 19:50 schrieb Ed Hammond via 4D_Tech <4d_tech@lists.4d.com>:
> 
> Hey all of you ORDA pioneers and converts!
> 
> 
> 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?
> 
> 
> 
> 
> 
> Edgar Hammond 
> ehamm...@questinformation.com
> 
> Quest Information Systems
> 
> 
> 
> **
> 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
> **


--
heubach media
Osterfeldstr. 12-14 | Haus 1 | Eingang Nord
22529 Hamburg
tel: 040 / 52 10 59 - 10 | fax: -99
mail: i...@heubach-media.de
home: www.heubach-media.de
Geschäftsführer|CEO: Matthias Heubach

Mieten Sie Ihre Computer, iPads & Drucker für Ihre Events bei:
http://www.milo-rental.com

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht 
gestattet.
 
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the
material in this e-mail is strictly forbidden.
**
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
**

Relation naming for ORDA in v17? Best Practices anyone?

2019-02-08 Thread Ed Hammond via 4D_Tech
Hey all of you ORDA pioneers and converts!


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?





Edgar Hammond 
ehamm...@questinformation.com

Quest Information Systems



**
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
**