
Select Interface Realization from the Class diagram menu. Open the specification for this attribute, and set: To create the default value, right-click the Default Value field, select Value Specification -> Literal Integer, and then type in the number 0. Don't give the attribute a Name or a Type. Add an attribute with a default value of 0.Base Classifier: Port from the UML Standard Profile::UML 2.0 Metamodel::CompositeStructures::Ports package.Create a normal Class called Partner, and then open its specification.

It should have the same attribute as for the IHwIn interface.Ĭreate a Port class within the HelloWorldTutorial package, using the class diagram. (see note at end of this document re signals as attributes of an Interface rather than as operations)Ĭreate a second Interface called IHwOut. To make the attribute visible in the class diagram, right-click the new Signal class and unselect Presentation Options -> Suppress Attributes. The new attribute should have a Visibility of public, should have no Name, should have a Type of SIGNAL_ONE (the Signal class created above), should have Is Read Only = true and Is Static = true. Select Attributes in the tree browser on the left, and then press the Create button. Open the specification for the Interface. Do this by clicking the Interface symbol in the class diagram menu. To make the attribute visible in the class diagram, right-click the new Signal class and unselect Presentation Options -> Suppress Attributes.Ĭreate an Interface within the HelloWorldTutorial package. To set the Is Read Only property, you may need to make it visible by first selecting Properties: Expert near the top of the specification window. Enter the value 100 as the Default Value, set Is Read Only to true, and set Visibility to public. Click the Signal icon that will appear in the menu. Do this by clicking the small triangle next to the Class symbol in the class diagram menu. XholonClass should remain within the HelloWorldTutorial model rather than within the package.Ĭreate a Signal class within the HelloWorldTutorial package. If they are not, drag them inside using the MagicDraw tree browser. Make sure that the three new classes are within the HelloWorldTutorial package. Applied Stereotype for Hello and World: PureActiveObject.You can do this by selecting the Generalization icon from the class diagram menu, clicking on the class, dragging until the cursor is over XholonClass, and then releasing the mouse button. Base Classifier for all three: XholonClass, so they can own Ports.It's easiest to do this by clicking the Class symbol in the class diagram menu, and then clicking within the diagram itself.

The new class diagram should open up in MagicDraw.ĭrag the XholonClass class from the browser to the diagram.Ĭreate three classes within the new HelloWorldTutorial package. To do this, right-click the HelloWorldTutorial package icon, select New Diagram -> Class Diagram, and name it InheritanceHierarchy. To do this, right-click the HelloWorldTutorial model icon, select New Element -> Package, and name it HelloWorldTutorial.Ĭreate a class diagram that can be used to create classes. These stereotypes will have Metaclass=Class.Ĭreate a package called HelloWorldTutorial.

The stereotypes can be created by selecting Applied Stereotype in the class's Properties pane.
