How to create abstract class in MagicDraw

2019-07-08 19:11发布

问题:

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.

回答1:

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:

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.)

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.