c# - Examples for Entity Framework 4: Mapping POCOs to EAV database? -


our customer advertises products product's attributes vastly different 1 another. there many product "classes" there products.

originally, created eav database added , removed attributes each "class" of product. whole thing works well, complexity mind numbing. this database #1.

we came set of fields common represent products (pocos), moving "extra" fields xml field "catch all". this database #2.

now have customers using old , customers use new. didn't want update old until needed so, have changes time time take longer necessary because of eav structure.

questions:

  1. any examples out there on how code ef persist pocos eav databases (where have table of field names , table of data)?
  2. should scrap database , write "normal" tables older customers, given have changes time time?

normal of course referring boyce codd normal form.
we handled older database bleeding structure software, mapping pocos in repository.

eav tables messy business, , joe celko (in avoiding eav of destruction) , lot of other industry experts (e.g. five simple database design errors should avoid) rightfully warn against using eav constructs much.

all database critics aside: how object in .net based on such eav like?? have number of properties of type, basically, have "universal" object can take on shape, pretty much.

this thought makes skin crawl , goes against basic concepts of typed language - yes, can stuff in dynamic language ruby , python, in c#?

the viable option have might come new "dynamic" type in .net 4.0 , expandoobject - object can take on shape, have properties of type, , whatever want be.

you imagine mapping between eav structure in sql server , expandoobject in c# 4.0 - highly doubt ef team has done in respect, , quite honestly, don't think time soon. might possibility explore.

for expandoobject, see:


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -