Dynamic Attribute Entity in Mendix

0
If I have a requirement where dynamic attributes are required for scenario. Ex.  Order → product → component   component 1 → property A1, Property A2 component 2 → property B1, Property B2   Should we go for EAV model?   ID | component id | property name | property value 1 | 1 | property A1 | value A1 2 | 1 | property A2| value A2 3 | 2 | property B1 | value B1 4 | 2 | property B2 | value B3   Or some Json Approach?   ID | component id | properties(string, unlimited) 1 | 1 | { “property A1” : “value A1”,  “property A2”: numA2} 2|2 | { “property B1” : “value B1”,  “property B2”: numB2}   Any thoughts on disadvantages of both approaches and which is best suitable in Mendix platform? edit : use case elaborated   1. In my use case, I have order which can have multiple components. Each component has 40+ attributes. 2. I have 100+ type of components. Every component have different set of attributes. 3. My application is not concern with the attributes stored as they needs to be passed to other system at a certain stage. But has to be stored temporarily. 4. It should be scalable to accommodate more products.
asked
1 answers
0

Depending on your situation, this could be something that works.

Here you Component Type defines what properties a Component of that kind can have. Then for an individual component, the Value will define the value of the property.

Then this can be made fancier, with handling types, etc.

 

answered