We have a database with tables that use an inheritance hierarchy. An entity in the derived table will have an ID that matches an entity in the base table and so on through the hierarchy.
We have repository classes for the derived types/tables so that you can get specific instances by ID. The problem we have at the moment is that we want the ability to apply specific behaviour to some of the entities, but we also want some generic behaviour applied to all the base entities. It would be good if a client could treat a collection of entities as the base entity and just call the method to perform this action on it, without having to know about the specific behaviour.
So the client will receive from the server a collection of entities, including their ID. The client will then call a method on the server with some of those IDs and somehow the server needs to be able to tell which derived types the IDs belong to.
I considered leaving the table inheritance in place so that data isn't duplicated, but having a "type" tag in the base-table. Is this defeating the purpose of the inheritance hierarchy?