Rails - Single Table Inheritance or not for Applicant/Employee relationship

喜你入骨 提交于 2019-12-02 07:40:40

As per my personal opinion , in OO point of view you are correct.

Applicant < Person

Employee < Person

But when it comes to database/ tables i will go for a one table called 'persons' (Person) that has all the columns for both 'Applicant' and 'Employee' and have a column with a flag indicating whether the Person is an Applicant or Employee

NOTE :: but this is only true if you have ONLY 'several other fields' not many

HTH

sameera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!