Manel
Manel

Reputation: 40

How to create abstract class in 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.

Upvotes: 2

Views: 1734

Answers (2)

MustardMan
MustardMan

Reputation: 111

  1. Right click on your abstract class and choose "Edit Compartments"
  2. Select the "Element Properties" tab.
  3. Type to filter or scroll down to "Is Abstract" in the "Hidden" compartment and move it to the "Selected" compartment.

In addition to the text being displayed italics because of the Is Abstract property being set to true it will display "Is Abstract" in the box.

In MagicDraw 2021x R2 HR 4 if the attribute is true it shows "Is Abstract". If it is false the attribute shows "Is Abstract = false"

This is what it looks like in the diagram.

Sample Diagram

Upvotes: 0

Jim L.
Jim L.

Reputation: 6529

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:

enter image description here

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:

enter image description here

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.

Upvotes: 1

Related Questions