Inheritance & Database Design -


when model inheritance through class table inheritance relationships in database model, you...

1) include attribute (boolean 2 subtipes, string more subtipes) identifies particular subtipe of each record?

2) include identification foreign key table containing description of possible subtypes?

3) none of above , rely on "trial , error" lookup in subtables on few times needed?

i prefer in cases table per class hierarchy model, in 1 column discriminator column (you 1. solution). if need second table because of many subtypes needed, perhaps should break tables few tables, because suspect data reduntant, , null.

there table per subclass model, in have master table shared data, , child tables subclasses (data completly normalized) although working kind of data harder, except when maybe using orm tool nhibernate.

could provide concrete example of situation solving, because in these cases number of subclasses known up-front (like billingdetails -> creditcard, bankaccount etc...)


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -