2

Guys, I have been surfing thru the web to find a way that I could use Multiple-Table-Inheritance in LINQ-To-SQL. But it looks like that it only supports single table inheritance which is not the best way to achieve inheritance in a ORM framework. I got to read that this will be addressed in next LINQ and Entity framework implementations. But how longer a stay we are talking about? In the meantime, if any of you guys have tried out a work-around implementation to achieve this, please let me know. And I thought of using my leisure time to come up with such an implementation so suggestions are welcome!

/Bumble Bee

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
Illuminati
  • 4,539
  • 2
  • 35
  • 55
  • I don't understand your comment "single table inheritance which is not the best way to achieve inheritance in a ORM framework". Could you explain further? – Christian Hayter Nov 23 '09 at 12:32
  • Its an opinion rather than a fact - but the problem with single table is that it can create a large table that is sparsley populated which is generally considered poor schema design – Murph Nov 23 '09 at 13:19
  • @Christian : Murph has cleared the doubt I guess. To elaborate more , when you have inheritance hierarchy mapped to a single table there will be lots of null values in rows instead of real data. Think that you have GenericProduct table which would map information about all the product types that would possibly in the application. Information related to one product would not be relevent to another product so some fields would have to be left blank. That is why it is not a good design practice. – Illuminati Nov 23 '09 at 16:14

1 Answers1

1

Entity Framework supports table per type now: http://msdn.microsoft.com/en-us/library/bb399159.aspx

Murph
  • 9,985
  • 2
  • 26
  • 41