班级图与实体关系图(关系和基数)
UML类图中的关联和聚集的多样性与关系数据库中关系的基础性相同(实体关系图)吗?
Are the multiplicities of associations and aggregations in an UML class diagram the same as the cardinalities of the relationships in a relational database (Entity-Relationship Diagram)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之
,UML中多重性的概念与ERD中的基数相同。主要区别是术语。
。
首先,我们需要牢记
UML 2.5.1规格解释了第33页
简而言之,此处的集合是指链接到另一类给定实例的类的实例。因此,UML定义说多重性定义了在此类集合的允许大小上存在的约束。
有趣的是, peter chen> peter chen 他的第一篇论文。陈说“ 映射类型
1:1
,1:n
和n:m
,并解释说:我们必须小心术语。在这里, entity 是指某些属性的一组特定值,即一个实例,而 entity Setity Setity 是指我们通俗地称为“实体”的所有可能实例”。
总之,ERD和UML的措辞可能略有不同,但是在这两种情况下,有关一侧实例数的限制可能与另一侧的实例有关。
In short
Yes, the concept of multiplicity in UML is the same than cardinality in ERD. The main difference is the terminology.
Demonstration
First of all, we need to keep in mind the original meaning of cardinality, which means the number of elements in a given set.
The UML 2.5.1 specifications explain page 33 that
To make it short, the collection here refers to the instances of a class that are linked to a given instance of another class. So the UML definition says that the multiplicity defines the constraints that exist on the allowed size of such sets.
Interestingly, Peter Chen, the inventor of the ER model does not mention at all cardinality in his first papers. Chen speaks of "mapping types
1:1
,1:n
andn:m
and explains that:We have to be careful about the terminology. Here, the entity refers to a specific set of values for some attributes, i.e. an instance, whereas the entity set refers to all the possible instances of what we colloquially call "entity".
In conclusion, the wording of ERD and UML might be slightly different, but in both cases, it is about constraints regarding the number of instances on one side may be related to instances on the other side.