title: UML class aggregating to self
body: <p>My group and I are making a program, where we have a tree structure. In this tree structure we have made it such that a category can contain it self. The program is based on your expenses, so an example could be:</p>
  
  <p>You have bought 4 milk. The 4 items of milk are placed in the category "Milk". Each entry of milk has the price (along with other individual information) in another class which category aggregates. </p>
  
  <p>The trick is that we want the category class to be able to contain it self, so:</p>
  
  <p>The category "milk" is part of the category "Dairy Products", which in terms are part of the category "Groceries". </p>
  
  <p>The reason we want it to be like that, is so we can move batches of products at the time. So if you want to move Milk to a category called "Morning Stuff" you wouldn't have to move every single one, but instead just the entire category. </p>
  
  <p>The picture is how our current category class is modelled, but we were told we couldn't do it without much further explanation. Does UML allow this? If not, how can we model it with UML?</p>
  
  <p><img src="https://i.stack.imgur.com/moN1l.png" alt="Category UML part"></p>