hey

I have parent Person with two children Employee and Member, and Member has two children Regular and Premium.

I have implemented the Single Table Inheritance approach in the database. now i would like to ask about the datamapper, how should it look like?

should i have just PersonDataMapper class then behave properly according to the class being passed to me wether being Employee, Member, etc. ?

or should i have seperate datamapper class for each class? i.e. have PersonDataMapper , EmployeeDataMapper, MemberDataMapper etc.

Here is another demo:
class Person
{
}

class Member : Person
{
}

class Employee : Person
{
}

class Regular : Member
{
}

class Premium : Member
{
}

Now i would like to implement datamapper using Single Table Inheritance for the above class structure, how should it looks like?

thanks