Serialize a specification template for a database

OK, we need to calculate eligibility and rates for insanely complex insurance registration data. Policies may be available depending on age, employment characteristics, shoe size, etc. People born before 1962 can be excluded, except when they live in Texas and have a poodle, etc.

Thus, we can create classes that implement the specification template. We can socket and specifications, specifications, etc. It's great. But how do we serialize this in a database?

We could dump our C # classes in xml and leave this to that. But it is fragile, but almost impossible to request. Serializing a class in xml and dumping it into a large text field has a certain code smell.

Is there a canonical answer to the question of how to insert a nested specification into a database? My google-fu is not giving me the opportunity.

+3
source share
2 answers

Normalization, this can be the scourge of many projects.

In general, I take a pragmatic approach to have separate columns for something that you can request (and therefore index), and dump all the rest into a blob in serialized form.

If this is not an option for you, you will have to introduce redundancy in the table, creating columns that are not applicable to all rows.

I have not yet encountered one type of approach to this problem.

+1
source

, , , , - . , THAT .

+1

All Articles