I keep reading that a one-to-one relationship in a database is poor design, however I have a situation that to me seems natural. In my logic I have two classes that inherit from a base class. So both classes share a core set of properties that
are mapped into a base table. However, the extended properties are of course different for each extended class, so then I created separate tables for each type, and mapped to the base table via a one-to-one relationship. So an instance of either
class gets an entry in the base table, then another entry in one (but never both) of the extended tables, depending on it's specific class type.
To me that makes sense to have the database neatly follow the same lines of inheritance/separation in the logic. But again everyone says one-to-one is bad. Is the common approach just to put everything in one table, then null out any property
that doesn't apply?
View Complete Post