Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to "master" and "slave" in entity relationship?

Example: I have two tables in my database called classA and classB, and one table called classA_classB. The last one just defined two int fields with foreign keys to link between classA and classB. So one classA can have many classB, and many classA can link with the same classB. Simple stuff, so far.

The problem is, in my special case, that I have a classA which wants to link to another classA. I.e. a Student links to his friends, who are Students as well.

So analogue to the technique above, I have: student and student_student. student_student has two fields: student_id, student_id. Problem: Can't have two fields with same name!

So I must call them like: master_student_id, slave_student_id.

But I don't like the terms "Master" and "Slave", because these are reminders to a bad time in our pasts. It may sound silly but I think it's not correct to keep these, at least from a moral perspective. I know it's just a part of modern computer science,... but....

how else could I call them?

parent and child maybe? Also i'm not sure if there's really one entity "the chief" while the other is "the employee"... Student and Student are not hierarchical. But then, again, lets imagine we had two classes "Teacher" and "Student". That would be a clear hierarchy. However, I need a neutral solution because my framework threads these 1:n relationships allways the same way.

like image 382
openfrog Avatar asked Jan 06 '10 15:01

openfrog


People also ask

Is technology a slave or a master?

Th is series of questions has brought about a debate as to “whether technology is a master or a slave.” Th ose who claim that technology is a master believe that human beings have become slaves to technology in the sense that their entire lives are fashioned and controlled by technology.

What is master and slave concept?

Master/slave is a model of asymmetric communication or control where one device or process (the "master") controls one or more other devices or processes (the "slaves") and serves as their communication hub.


2 Answers

Parent and Child or Owner and Child is the generally accepted solutions.

like image 180
Kornel Kisielewicz Avatar answered Sep 19 '22 17:09

Kornel Kisielewicz


the industry standard nowadays seems to be {master-follower}

see the following references:

[01]
www.mchotline.com/Reference/MN20B302.pdf

[02]
www.ab.com/linked/drives/drvappsw/files/AppSets_PF700S/AS_PF700S_VirtEncdr_PositMaster_SL.pdf

[03]
www05.abb.com/global/scot/scot201.nsf/veritydisplay/bd987cd590c931fcc1257249003d8f4f/$file/factfile_master_follower_pd11_lowres.pdf

[04] www05.abb.com/global/scot/scot201.nsf/veritydisplay/a11e30d538ab1b49c2256def00493279/$file/en_800stdprg_mfguide_a.pdf

[05] www.danfoss.com/BusinessAreas/DrivesSolutions/MUSEC/

[06] forums.ni.com/t5/Motion-Control-and-Motor-Drives/Converting-a-master-follower-type-Cam-Grinding-Machine-to-CNC/td-p/1469070

[07] www.burhansresearch.com/mrcwfdbk1.htm

[08] www.eurekamagazine.co.uk/article/28893/Master-follower-communication-in-ABB-industrial-drives.aspx

[09] www.lockmasters.com/index.asp?PageAction=VIEWPROD&ProdID=49879

[10] www.perfusion.com/cgi-bin/forum/forum_posts.asp?TID=500

this also makes more sense - no need to employ a morally reprehensible term for a hierachical computer/technological controls arrangement... for example, we would designate connectors as "male" and "female", not "male" and "whore".... both cases "make the point" in a somewhat descriptive sense, however it is best to make the point using non morally reprehensible or inflammatory terms

excellent question, btw!

like image 21
Auden Avatar answered Sep 19 '22 17:09

Auden