Search code examples
umlclass-diagram

How to represent a many to many relationship in a uml class diagram


I have a question about a UML class diagram. Do many to many relationships have a junction table like in ERD diagrams or not? it would make sense for me having a junction table to put the quantity of items in there. Here is what I have but without a junction tableenter image description here


Solution

  • Sure there is. And it's called associaton class. The notation is like this:

    enter image description here

    This is a shortcut for

    enter image description here

    The OrderItem relates Item and PurchaseOrder by adding what ever needed (quantity, rebate, etc.) to it.