RAD Studio (Common)
ContentsIndex
PreviousUpNext
Using the Stub Implementation Pattern

This topic explains how to use the stub implementation pattern.

To create an inheritance link with stub implementation using the Link by Pattern button:

  1. Click the Link by Pattern button in the Tool Palette.
  2. Click the source class and drag-and-drop the link to the destination class or interface. The Pattern Wizard dialog box opens.
  3. In the Pattern Wizard, expand the Standard folder and select Implementation link and stub.
  4. 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:

  1. Click Node by Pattern the Tool Palette.
  2. Select the source class on the diagram. The Pattern Wizard opens.
  3. In the Pattern Wizard, expand the Standard folder, and select Implementation link and stub.
  4. 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.
  5. Select the destination class or interface from the treeview of available contents and click OK.
  6. 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:

  1. Right-click the source class on the diagram and choose Create by Pattern from the context menu. The Pattern Wizard opens.
  2. In the Pattern Wizard, expand the Standard folder and select Implementation link and stub.
  3. 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.
  4. Select the destination class or interface from the treeview of available contents and click OK.
  5. 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:

  1. Right-click a class that inherits from an interface or an abstract class.
  2. Choose Stub Implementation from the context menu.

To create a stub implementation using the Node by Pattern button:

  1. Click the Node by Pattern button in the Tool Palette.
  2. Select the source class on the diagram. The Pattern Wizard opens.
  3. In the Pattern Wizard, expand the Standard folder, and select Stub implementation.
  4. 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:

  1. Right-click the source class on the diagram and choose Create by Pattern from the context menu. The Pattern Wizard opens.
  2. In the Pattern Wizard, expand the Standard folder, and select Stub implementation.
  3. Click OK to complete the stub implementation and close the Pattern Wizard. The stubs for the inherited methods are generated in the source class.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!