1 Replies - 435 Views - Last Post: 10 February 2015 - 07:47 AM Rate Topic: -----

#1 LostTheMarbles   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 10-June 14

Polymorphism in databases

Posted 10 February 2015 - 01:14 AM

I have a base class which is extended 4 different ways to create 4 different categories of items, each on having up to 20 more specific properties, I'm looking for a nice generic way to put this into and retrieve it from a database in C# .Net.

We're not using any ORM in this project.

Any ideas?
Is This A Good Question/Topic? 0
  • +

Replies To: Polymorphism in databases

#2 modi123_1   User is online

  • Suitor #2
  • member icon

Reputation: 14146
  • View blog
  • Posts: 56,699
  • Joined: 12-June 08

Re: Polymorphism in databases

Posted 10 February 2015 - 07:47 AM

Look at building this from the parts needed.

20 or more properties? Cool beans - made a table that just holds properties. I guess a unique id and a name. Tables can have zero to many rows so you are good for anything new.
Different categories? Cool beans - make a table of categories that have id and a name.
Different items? Cool beans - make a table with an item id, name, etc. If the category to item relationship is one to one have a slot for a a category id.

Now the relational part. Have a table matching up property id to item ids.

Boom! A robust design!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1