UML metamodel: derived, derived union and subsetting

随声附和 提交于 2020-01-03 08:29:09

问题


If you have ever worked with the metamodel of UML, you propably know the concepts of unions and subsets - As far as I understand it:

  • Attributes and associations of an element/class marked as "derived union" cannot be used directly. In more specific sub-classes, you can possibly find subsets of them that can be used, as long as they are not marked as derived unions themselves.
  • "derived" (without union) attributes and associations have also subsets in more specific classes, but unlike above you can use them directly without having to look for subsets in more specific classes

My questions:

  1. Does this make sense or am I on the wrong track here?
  2. What is the meaning of the "/" (slash) you can find in front of some attributes/associations, that they have subsets in child-classes? E.g. /general : Classifier[*]

回答1:


An union property is a property that consists of multiple other properties. You can only understand the union, when you combine all subsets. A list is almost by definition an union. Almost, because it might be uninitialized.

A derived union is a property requiring a specific collection of subsets. I would not talk about accessing them directly, but about how direct you can understand them. You need all information before you can make an interpretation.

The difference between the two that a derived union requires a specific subset and an union might have a subset and might have different subsets in different contexts. A very simple example being the fields on a form. All required fields show the definition of a derived union. All other fields are part of the complete union.

Derived unions can contain derived unions in their subsets. It directs the creation of classes and their instances, it does not make them impossible.

All derived features require other features to be known. Temperature can be read directly, but to know if someone has fever requires more knowledge, like the time of the day, the place of collecting information etc..

The slash implies that it is being derived.



来源:https://stackoverflow.com/questions/16614366/uml-metamodel-derived-derived-union-and-subsetting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!