Is it possible to add a database to a Dynamic Data Website (ASP.NET) at runtime?
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 sto开发者_运维问答re 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
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.
精彩评论