0

How do I go about modelling recursive optional dependency? Like a product may be comprised of other products? but can also be sold alone. I'd like to be able query a chimeric product from the top down i.e. from the parent to children as opposed to querying children who have the same parents, which is what my current design solution does.

Dark Star1
  • 6,986
  • 16
  • 73
  • 121
  • 1
    http://sqlblog.com/blogs/john_paul_cook/archive/2009/11/06/bill-of-materials-the-basics.aspx has a really good discussion of this. – Neville Kuyt Nov 30 '11 at 11:09

1 Answers1

1

You need the bill of materials pattern for this type of requirement. The comment by Neville K points to a good blog about bill of materials.

In order to make it easier to work with the unlevel tree structure that such a design involves, you can use a physical implementation technique called visitation numbers, which I describe in some detail in my answer to this question.

Community
  • 1
  • 1
Joel Brown
  • 14,123
  • 4
  • 52
  • 64