I'm building an product inventory application which allows users to create a master template for a product, for example:
CPU
- cpu_option1
- cpu_option2
- cpu_option3
MEM
- mem_option1
- mem_option2
- mem_option3
When I select cpu_option1
then mem_option2
and mem_option3
are not available.
These rules are not pre-programmed, these rules are created/changed by any user
I'm searching far and wide for examples of these kinds of smart attributes and how to implement the logic/design pattern.
ontopic: I'm looking of a design pattern of storing and using these rules
The DB could look like this:
Compontents (id, name)
1 - CPU
2 - MEM
Options (id, name)
1 - cpu_option1
2 - cpu_option2
3 - cpu_option3
4 - mem_option1
5 - mem_option2
6 - mem_option3
Components2Options (cid, oid)
1 - 1
1 - 2
1 - 3
2 - 4
2 - 5
2 - 6
Options2Combine (oid1, oid2)
1 - 4
2 - 5
3 - 5
3 - 6
This example shows that
If this answer your question?