3

i am implementing a web-based process management engine and i am facing some problems:

A process model has different object types with attributes, e.g.
Model "Recruitment":
Employee(Name, Birthday, Department)
Application(Date, ...)
Applicant(Name, Birthday, ...)

Every model has its own database and every object type instance is stored in a separate table within this db. (yes, it is pretty denormalized …) At runtime it is possible that new models are added which results in additional databases with different schemes to handle.

Dynamic Data in ASP.NET works with db schemes which are already there. Is it possible to add these new databases (works) and create the corresponding LINQ2SQL classes at runtime?

I could (re-)normalize the tables and store all models and the data in the same database (so i would know the scheme at built-time), but since it is a multi-user system with a huge number of instances in each table, it is just too complex (joins, etc.) …

Any ideas? Thanks in advance

Stefan

Stefan
  • 31
  • 2
  • Have you looked at using something like RavenDB? http://www.ravendb.net – Derek Beattie Jul 28 '11 at 01:02
  • It looks interresting but unfortunately i stuck with a SQL database, because the modeling component works on this basis and there is no chance to change this, because I'm not responsible for the modeling component. It looks like i have to deal with it by writing dynamic code without a LINQ mapping. – Stefan Jul 28 '11 at 10:23
  • Let me test my understanding, You will be provided dynamically with a new database name and you will be provided with the tables inside this database and the fields of each table and you have to manage the insertion of new records in this database dynamically ?! – Samir Adel Jul 29 '11 at 18:56

1 Answers1

0

If you have dynamic data definition language and need to add new objects occasionally, one DB approach is to use an EAV model, where the prinicipal DB table (like customers) is keyed to an attributes table (containing the dynamic attributes of a customer) and another table has the keyed values for each attribute.

Using this method you could hardwire your DD application to the EAV model, then add object and attributes at will, without any specified changes to data definition language in the DB.

Ash Machine
  • 9,601
  • 11
  • 45
  • 52