UML association multiplicity

前端 未结 3 1070
没有蜡笔的小新
没有蜡笔的小新 2020-12-28 17:49

I have a question about association multiplicity. I understand it, but for example if I would have:

 ---------            ---------
|         |1      *  |            


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-28 18:32

    dose that mean that at ANY point during system existence there must be at least 1 student assigned to the class

    It means there is exactly one class assigned to multiple students.

    Each end of the association has an upper multiplicity boundary and a lower multiplicity boundary, but most UML editors will only show one value if the upper and lower boundaries are the same. If you want to allow (zero or one) to many, you can write it like this:

    0..1      *  
    -----------
    

    What you really probably want here is a many-to-many relationship... students can be in many classes, and classes can contain many students.

提交回复
热议问题