UML三元关联 [英] UML ternary association

查看:386
本文介绍了UML三元关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在理解UML中的三元关联时遇到了一些麻烦.我得到了二进制的,但是我不确定多重性在三进制上是如何工作的.我正在做我从大学里得到的锻炼,当前的锻炼是这样的:

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 that I got from my university, the current one goes like this:

一个部门可以销售许多产品,但只能销售到一个市场.在市场上,一种产品只能由一个部门销售.

One department may sell many products, but only to one market. On a market one product may only be sold by one department.

我从不同的来源阅读了关于我应该如何考虑两个类中的一对的信息,但我不想弄清楚它的多样性.帮我溢出Kenobi,您是我唯一的希望.

I've read on different sources about how I'm supposed to think about a pair of the two classes I'm not trying to figure out the multiplicity for, but my brain just isn't getting it. Help me Overflow Kenobi, you're my only hope.

推荐答案

在三元关联的多重性规范中似乎有些含糊.另请参见本文

There seems to be some ambiguity in the specification of multiplicities on ternary associations. See also this paper

但是我这样理解:

多重性说明了对于给定的链接实例元组,实例在此关联中可能存在多少次.

作为示例,请考虑以下(传统)系列
我会理解为

As an example, consider the following (traditional) family
I would understand that as

在任何给定的家庭中,必须有一个父亲,一个母亲和零个或多个孩子.

如果我们将其应用于您的案件,那么我会得出这样的结论:

If we apply that to your case then I come to something like this:


我理解为


I understand that as

对于任何给定的产品,必须确切地有一个市场,一个部门和一个或多个产品

这似乎可以或多或少地满足您的所有限制

That seems to satisfy more or less all of your constraints

  • 一种产品只能由一个部门提供给一个市场
  • 一个部门可以提供多种产品,但是一种产品只能提供给一个市场

虽然我不认为它是防水的,但是正如论文已经指出的那样,UML没有足够的工具来进行防水设计,仅在其末端具有多重性.因此,为获得良好的效果,您的约束也应建模为UML约束.

I don't think it's waterproof though, but as the paper already stated, UML does not have enough tools to make a waterproof design with the multiplicities on the ends alone. So for good measure, your constraints should also be modeled as UML constraints.

免责声明:三级协会确实非常适合学术讨论,但并没有真正在(IT)行业中使用,可能是因为它们太难理解了.

Disclaimer: Ternary associations are really nice for academical discussions, but are not really used in the (IT) industry, probably because they are so hard to understand.

这篇关于UML三元关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆