谁是关系的主人?
Who is the owner of a relationship?
根据 UML 规范,每个 Element
都可以有一个所有者。他 has/must 是否有所有者由方法 mustBeOwned(): Boolean
确定,默认情况下是 true
(参见 specs 中的 7.8 分类器描述)。
在元素完全被其所有者包围的情况下(例如包中的 class),这是很明显的。
但是对于关系(正常、定向、泛化……)我没有找到任何规范。 “来源”(至少是定向的)也是所有者吗?
它是所有权链中的第一个共同所有者吗?因此,例如同一包中两个 class 之间的关联,关联的所有者将是包。
或者它只是没有定义,它可以是我想要的任何东西?
说实话,上层建筑的术语定义还是很差
仔细看更糟(引用自 ptc 13-09-05)。
人际关系(第 15 页)
A Relationship is an Element that specifies some kind of relationship between other Elements. Descendants of Relationship provide semantics appropriate to the concept they represent.
连接器(第 235 页)
A Connector specifies links that enables communication between two or more instances. In contrast to Associations, which specify links between any instance of the associated Classifiers, Connectors specify links between instances playing the connected parts only.
我不知道他们在两者之间产生了差异。显得很挑剔。
协会(第 206 页)
An Association classifies a set of tuples representing links between typed instances. An AssociationClass is both an Association and a Class.
没有提到 Relationship
是 parent。
正在寻求关于owner
的真相
所有者(第 37 页)
/owner : Element [0..1]{union} (opposite Element::ownedElement) The Element that owns this Element.
mustBeOwned(有点低)
mustBeOwned() : Boolean
The query mustBeOwned() indicates whether Elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation.
所以这里卡住了,除非读到
协会(第 209 页)
Ownership of Association ends by an associated Classifier may be indicated graphically by a small filled circle, which for brevity we will term a dot. The dot is to be drawn integral to the graphic path of the line, at the point where it meets the Classifier, inserted between the end of the line and the side of the node representing the Classifier. The diameter of the dot shall not exceed half the height of the aggregation diamond, and shall be larger than the width of the line. This avoids visual confusion with the filled diamond notation while ensuring that it can be distinguished from the line. The dot shows that the model includes a Property of the type represented by the Classifier touched by the dot. This Property is owned by the Classifier at the other end. In such a case it is normal to suppress the Property from the attributes compartment of the owning Classifier.
回答?
最有可能 (!) 的连接器没有 mustBeOwned
约束并且 可以 拥有,在这种情况下您将看到 2.5 引入的点。否则他们可能不被拥有。
据我了解,关系通常不属于它所连接的元素。拥有的是关联(关系)端的和对应的attributes/properties。第 6.4.2 节。 UML 规范 2.4.1 比您链接的 2.5 beta 更清楚地说明了这一点。我建议您使用当前正式版的 specs 而不是 beta 版。我觉得2.5有点看不懂,table的内容看起来很乱
关系本身是独立存在的,没有所有者。除非具体的关系类型另有说明(如泛化情况)。
这让我进入了我按问题回答的要点。为什么你需要知道?
多年来一直在阅读和解释规范,但从未遇到过如此具体的问题,而且规范中也有相对明确的说明。
我建议查看具体关系并搜索 (Ctrl+F) "owned"(从 2.4.1 中的第 40 页开始,协会有超过一页的文字详细介绍了这个主题).
我自己也一直在琢磨什么可以拥有一个Association实例。我正在使用 2.4.1。在我看来,这似乎是标准实际上不可用的(另一个)案例。
我还没有看过关系的所有专业。我看过协会。它继承了 Element 的 owner。 属性 被标记为派生联合。我找不到子集 owner 的任何 属性 协会(或其任何前身)。既然如此,我看不出协会怎么会有主人。
我认为一个包拥有一个协会似乎是合理的。
我正在使用一个 UML 工具,它肯定会为关联初始化 owner 的值。我正在以编程方式解释在该工具中创建的模型,并将它们用作我正在使用的其他建模工具的输入。第一个工具的制造者显然只能编造/猜测事情,现在我必须决定他们所做的是否实际上是理性的,以及我是否愿意同意他们的结论(这恰好允许分类器拥有关联,我认为很奇怪)或做其他事情。谢谢天哪。呜呜呜。
我想知道旧版本的规范是否更加清晰?
根据 UML 规范,每个 Element
都可以有一个所有者。他 has/must 是否有所有者由方法 mustBeOwned(): Boolean
确定,默认情况下是 true
(参见 specs 中的 7.8 分类器描述)。
在元素完全被其所有者包围的情况下(例如包中的 class),这是很明显的。
但是对于关系(正常、定向、泛化……)我没有找到任何规范。 “来源”(至少是定向的)也是所有者吗?
它是所有权链中的第一个共同所有者吗?因此,例如同一包中两个 class 之间的关联,关联的所有者将是包。
或者它只是没有定义,它可以是我想要的任何东西?
说实话,上层建筑的术语定义还是很差
仔细看更糟(引用自 ptc 13-09-05)。
人际关系(第 15 页)
A Relationship is an Element that specifies some kind of relationship between other Elements. Descendants of Relationship provide semantics appropriate to the concept they represent.
连接器(第 235 页)
A Connector specifies links that enables communication between two or more instances. In contrast to Associations, which specify links between any instance of the associated Classifiers, Connectors specify links between instances playing the connected parts only.
我不知道他们在两者之间产生了差异。显得很挑剔。
协会(第 206 页)
An Association classifies a set of tuples representing links between typed instances. An AssociationClass is both an Association and a Class.
没有提到 Relationship
是 parent。
正在寻求关于owner
所有者(第 37 页)
/owner : Element [0..1]{union} (opposite Element::ownedElement) The Element that owns this Element.
mustBeOwned(有点低)
mustBeOwned() : Boolean The query mustBeOwned() indicates whether Elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation.
所以这里卡住了,除非读到
协会(第 209 页)
Ownership of Association ends by an associated Classifier may be indicated graphically by a small filled circle, which for brevity we will term a dot. The dot is to be drawn integral to the graphic path of the line, at the point where it meets the Classifier, inserted between the end of the line and the side of the node representing the Classifier. The diameter of the dot shall not exceed half the height of the aggregation diamond, and shall be larger than the width of the line. This avoids visual confusion with the filled diamond notation while ensuring that it can be distinguished from the line. The dot shows that the model includes a Property of the type represented by the Classifier touched by the dot. This Property is owned by the Classifier at the other end. In such a case it is normal to suppress the Property from the attributes compartment of the owning Classifier.
回答?
最有可能 (!) 的连接器没有 mustBeOwned
约束并且 可以 拥有,在这种情况下您将看到 2.5 引入的点。否则他们可能不被拥有。
据我了解,关系通常不属于它所连接的元素。拥有的是关联(关系)端的和对应的attributes/properties。第 6.4.2 节。 UML 规范 2.4.1 比您链接的 2.5 beta 更清楚地说明了这一点。我建议您使用当前正式版的 specs 而不是 beta 版。我觉得2.5有点看不懂,table的内容看起来很乱
关系本身是独立存在的,没有所有者。除非具体的关系类型另有说明(如泛化情况)。
这让我进入了我按问题回答的要点。为什么你需要知道?
多年来一直在阅读和解释规范,但从未遇到过如此具体的问题,而且规范中也有相对明确的说明。
我建议查看具体关系并搜索 (Ctrl+F) "owned"(从 2.4.1 中的第 40 页开始,协会有超过一页的文字详细介绍了这个主题).
我自己也一直在琢磨什么可以拥有一个Association实例。我正在使用 2.4.1。在我看来,这似乎是标准实际上不可用的(另一个)案例。
我还没有看过关系的所有专业。我看过协会。它继承了 Element 的 owner。 属性 被标记为派生联合。我找不到子集 owner 的任何 属性 协会(或其任何前身)。既然如此,我看不出协会怎么会有主人。
我认为一个包拥有一个协会似乎是合理的。
我正在使用一个 UML 工具,它肯定会为关联初始化 owner 的值。我正在以编程方式解释在该工具中创建的模型,并将它们用作我正在使用的其他建模工具的输入。第一个工具的制造者显然只能编造/猜测事情,现在我必须决定他们所做的是否实际上是理性的,以及我是否愿意同意他们的结论(这恰好允许分类器拥有关联,我认为很奇怪)或做其他事情。谢谢天哪。呜呜呜。
我想知道旧版本的规范是否更加清晰?