2

I have a simple relationship between product and category I came up with this diagram:

enter image description here

  • A product can be assigned to 1 or many categories
  • A category can have 0 or many sub-category
  • A category can have 0 or 1 parent category
  • When you delete a category the sub-categories still exist.

I want to be sure that the diagram has a correct cardinality, especially category to category relation.

iOSGeek
  • 5,115
  • 9
  • 46
  • 74

1 Answers1

8

Almost correct.

enter image description here

Use roles to clearly identify parent/sub-category along with their multiplicities. The hollow diamond makes it a shared aggregation which means the sub-category lives independent of its parent (else you would use a filled diamond).

qwerty_so
  • 35,448
  • 8
  • 62
  • 86