Alternative to STI model

393 views Asked by At

I have a project where a User can manage (CRUD) 1 or n Clients. Each of those have one type; either Natural Person or Legal Person.

I initially thought about creating a Client model with a type column in order to use the STI pattern; while having two classes NP and LP that would inherit from Client.

I did some research about the STI concept and this article has convinced me to go with a different approach. My main reason is that my two models NP and LP, will not have so many fields in common, and I want to avoid having too many columns with a null value in my DB.

So I was wondering how can I have a user managing a Client whether it is a Natural or a Legal person.

Thanks for your help

0

There are 0 answers