I am having a hard time seeing the proper solution. Maybe someone on the forum has been down this road.
I am interested in setting up a CMS system that can invoke specific entities based on the type of content I am dealing with. For example if I am working with text content I would like to use a CMSTextEntity, if it needs binary content I would like to use a CMSBinaryEntity. Basically an entity per type of content that I manage.
My table structure at the moment consists of a ContentItem table (1) and a ContentDetail table (M) . The Detail table is giving me headaches. At the moment it contains a number of fields corresponding to the various types of content I work with. There is a field called BinaryValue which is datatype binary, a field called TextValue which is of course a string datatype. A field called IntegerValue which - you guessed it - is of a datatype integer. My DB allows for XML datatypes so I have a corresponding XMLValue field in the table.
I am stuck on what steps I need to take to break apart the ContentDetail into - I guess - a number of smaller tables ( one per datatype ) and relate those back to the SuperType of ContentDetail. Do I use the same PK value between Super Type and Sub Type? Do I need to add a distinguishing characteristic to the super type that allows the logic to pick an appropriate subtype for a given row. Ie. something like a "ContentDetailType" field that allows the logic to go to the TextValue SubType for one row and to the Binary sub type for a different row? A traffic cop for lack of better words.
If you had to deal with a similar situation I would love to hear how you approached this.
Thanks!
Thomas