This topic explains how to use the stub implementation pattern.
To create an inheritance link with stub implementation using the Link by Pattern button:
- Click the Link by Pattern button in the Tool Palette.
- Click the source class and drag-and-drop the link to the destination class or interface. The Pattern Wizard dialog box opens.
- In the Pattern Wizard, expand the Standard folder and select Implementation link and stub.
- Click OK to complete the stub implementation. The inheritance link is created and the stubs for the inherited methods are generated in the source class.
To create an inheritance link with stub implementation using the Node by Pattern button:
- Click Node by Pattern the Tool Palette.
- Select the source class on the diagram. The Pattern Wizard opens.
- In the Pattern Wizard, expand the Standard folder, and select Implementation link and stub.
- In the Pattern Properties pane on the right of the Pattern Wizard, click the information button to the right of the Supplier field. The Select Supplier dialog opens.
- Select the destination class or interface from the treeview of available contents and click OK.
- Click OK to complete the stub implementation and close the Pattern Wizard. The inheritance link is created and the stubs for the inherited methods are generated in the source class.
To create an inheritance link with stub implementation using the Create by Pattern context menu:
- Right-click the source class on the diagram and choose Create by Pattern from the context menu. The Pattern Wizard opens.
- In the Pattern Wizard, expand the Standard folder and select Implementation link and stub.
- In the Pattern Properties pane on the right of the Pattern Wizard, click the information button to the right of the Supplier field. The Select Supplier dialog opens.
- Select the destination class or interface from the treeview of available contents and click OK.
- Click OK to complete the stub implementation and close the Pattern Wizard. The inheritance link is created and the stubs for the inherited methods are generated in the source class.
Note: You can find the Stub implementation pattern on the context menu of classes that inherit from an interface or an abstract class. This pattern is also available in the Pattern Wizard by clicking the Node by Pattern button in the Tool Palette, or by using the Create by Pattern context menu for a class. Use the Stub implementation pattern if you already have an inheritance/generalization link drawn on the diagram and you want to copy the methods to the source class.
To create a stub implementation using the class context menu:
- Right-click a class that inherits from an interface or an abstract class.
- Choose Stub Implementation from the context menu.
To create a stub implementation using the Node by Pattern button:
- Click the Node by Pattern button in the Tool Palette.
- Select the source class on the diagram. The Pattern Wizard opens.
- In the Pattern Wizard, expand the Standard folder, and select Stub implementation.
- Click OK to complete the stub implementation and close the Pattern Wizard. The stubs for the inherited methods are generated in the source class.
To create a stub implementation using the Create by Pattern context menu:
- Right-click the source class on the diagram and choose Create by Pattern from the context menu. The Pattern Wizard opens.
- In the Pattern Wizard, expand the Standard folder, and select Stub implementation.
- Click OK to complete the stub implementation and close the Pattern Wizard. The stubs for the inherited methods are generated in the source class.