UML ternary association

后端 未结 4 904
隐瞒了意图╮
隐瞒了意图╮ 2021-01-04 13:44

I\'m currently having some trouble understanding ternary associations in UML. I get the binary ones, but I am unsure how multiplicity works on ternary. I\'m doing exercises

4条回答
  •  盖世英雄少女心
    2021-01-04 14:20

    This unspecific ternary association just tells that you have relations where

    • Market controls Department-Product,
    • Department controls Market-Product and
    • Product controls Department-Market.

    There is no statement as to how the single classes control the other two.

    The UML specs is not defining the ternary operator in detail. So using that element seems to be on your own risk. You could blame OMG for using but not defining it more than

    Any Association may be drawn as a diamond (larger than a terminator on a line) with a solid line for each Association memberEnd connecting the diamond to the Classifier that is the end’s type. An Association with more than two ends can only be drawn this way.

    and a single example in a picture on p. 202.

    The simple association class

    tells you that the Product is in between Department and Market where the multiplicity 1 tells that there's only one Market for a Department. That's more what your requirement sounds like.

    N.B. It does not make much sense to split hairs regarding the requirements, so as "is there a Product without a Market". Those are details which need to be discussed with domain specialists before being fixed in a model.

提交回复
热议问题