如何在MagicDraw中创建抽象类 [英] How to create abstract class in MagicDraw
问题描述
我是MagicDraw的新手,我想知道如何将一个类指定为{抽象}.
I'm newbie in MagicDraw and I'd like to know how to specify a class as {abstract}.
我知道类规范"中的属性是抽象的",但我希望它出现在标题中.
I know about de property "Is abstract" in the Specification of Class, but I'd like that it appears in the header.
推荐答案
在MagicDraw中设置isAbstract
的位置在该类的规范窗口中.要打开该窗口,请在班级上单击鼠标右键,或在选定班级时按Enter键.窗口将如下所示:
The place where you set isAbstract
in MagicDraw is in the specification window for the class. To open that window, either right-click on the class or press enter while it is selected. The window will look like this:
您没有特别要求提供更多信息,但如果您认为有帮助,我会提供.
You didn't specifically ask for more information, but I'll provide it in case you find it helpful.
您要创建的模型如下所示:
The model you want to create will look like this:
请注意,Abstract Class
用斜体字表示它是抽象的.还要注意,为通用化集指定了{complete, disjoint}
. (仅供参考,{complete}
也称为覆盖公理.)
Notice that Abstract Class
is written in italics to indicate it is abstract. Also notice that {complete, disjoint}
is specified for the generalization set. (Just FYI, {complete}
is also known as a covering axiom.)
请注意,如果您未指定{complete}
,则会与isAbstract
元属性产生冲突.发生冲突的原因是,在UML中,默认值为{incomplete}
,这意味着您可以创建超类的实例,而不必同时将其作为子类之一的实例.与isAbstract
冲突.
Beware that if you do not specify {complete}
, you're creating a conflict with the isAbstract
meta-property. The reason there's a conflict is that in UML, the default is {incomplete}
, which means that you are allowed to create an instance of the super-class without it also being an instance of one of the sub-classes. That conflicts with isAbstract
.
这篇关于如何在MagicDraw中创建抽象类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!