|
|
|
|
|
by jmnicolas
3986 days ago
|
|
"Use a collective name or, less ideally, a plural form. For example (in order of preference) staff and employees." This goes contrary to what I was taught : use singular form. When I model my databases I think in those terms : employee works for 1 to n company, company has 0 to n employee.
Since it's a "many to many" relationship you need a third table (entity really) which you could call "working_with". The columns are id_employee and id_company. This is the basis of the Merise method, but I don't think it's available in English. It makes modeling databases really easy. |
|
- mapping is not intuitive for non-native English speakers (flora, really?!)
- manual table mapping needed for ORM systems
I'd prefer the singular, but ActiveRecord uses the plural, and I'd rather go along with the default, rather than fight and create friction for my team.
EDIT: looking closer, the style guide is great, but the naming conventions are atrocious. I'm reminded of what my Intro to CS TA told us: naming stuff is hard, so try to explain your code. If you have to explain what something is, the explanation should be the name (within reason)