Example
I have Person
, SpecialPerson
, and User
. Person
and SpecialPerson
are just people - they don\
What I'm going to say here is going to send database architects into conniptions but here goes:
Consider a database view as the equivalent of an interface definition. And a table is the equivalent of a class.
So in your example, all 3 person classes will implement the IPerson interface. So you have 3 tables - one for each of 'User', 'Person' and 'SpecialPerson'.
Then have a view 'PersonView' or whatever that selects the common properties (as defined by your 'interface') from all 3 tables into the single view. Use a 'PersonType' column in this view to store the actual type of the person being stored.
So when you're running a query that can be operated on any type of person, just query the PersonView view.