Liqz wrote:
I thought of having, in the database table, an owner (ID?) field and an owner type field (this seems the best way so far).
You thought correctly, it enables you to lookup the type based on the OwnerID without storing duplicates :) It is dangerous to instantiate something that you do not know - since it might, for example, delete all records in a table on startup, as initialization. Even if you're sure that nothing can go wrong, then it would still be slow, as you already stated.
Liqz wrote:
what is the best way to determine the owner? i.e. what type of object.
If you can't ask the owner-object itself, then you'll have to resort to keeping track of that information elsewhere. Like tracking it in a database :thumbsup:
I are troll :)