This is a migrated thread and some comments may be shown as answers.

Dynamic Columns

1 Answer 35 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bilal Haider
Top achievements
Rank 1
Bilal Haider asked on 03 Aug 2014, 10:44 AM
As per the business requirements, we are suppose to provide the facility to create dynamic columns for ANY table at the runtime (when setting up the system for first time or reflecting the business rule upgrade).

As an initial possible solution, we are going for a three table solution
1. Table Index
2. another table having the table index and the details of the custom field
3. another table referencing the custom field, the row id of the corresponding table and a column saving the value for custom field

In the prototype, before the appearing of this business rule, we adopted the database first approach but for the product we had reached the conclusion of code first (fluent API) approach.
Now, after this new business rule,
- Will we be able to implement this requirement using DataAcess?
-- Is it still possible to proceed with the code first approach?
--- Or we should go for some other approach to this business requirements

We have done only a single prototype using DataAccess and not sure of its capabilities and limits

PS: Note to moderators, if this post is miss-categorized, pls rectify it.

1 Answer, 1 is accepted

Sort by
0
Viktor Zhivkov
Telerik team
answered on 06 Aug 2014, 03:12 PM
Hello Bilal,

You are describing a scenario that we have nice and tidy solution for - Artificial Types and Fields.
This feature allows you extend your domain model during runtime and still enjoy the performance of normal relational tables and structures.
The approach uses Code First approach (as we call it - Fluent Mapping).
When defining extensions to types or even whole types Telerik Data Access will generate the appropriate mapping and relational definitions including SQL script to update your database on the fly to accommodate the changes.
You can check our Data Access Samples Kit companion product which contains dedicated sample demonstrating working with Artificial Types and Fields.
After downloading and installing the Samples Kit product look for the "Consuming Types Defined During Runtime" sample in Fluent Mapping category.

Based on my previous experience in software development Artificial Types are easier to manage and perform better than most alternatives (like Entity-Attribute-Value pattern that you are describing).

One was note - if you know that your object have weak typing and their schema is very dynamic you may consider switching to NoSQL persistence solution that will allow you to store whole objects rather than their strict relational representation.

Regards,
Viktor Zhivkov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Development (API, general questions)
Asked by
Bilal Haider
Top achievements
Rank 1
Answers by
Viktor Zhivkov
Telerik team
Share this question
or