Chapter 3 Building Structural Diagrams
Overriding an attribute in PowerBuilder
The Inherited Attributes dialog box allows you to:
- View the attributes inherited from the parent classes or interfaces
- Override an attribute, this feature is only available in PowerBuilder
Within the context of an inheritance, you can add an attribute that belongs to a parent class to a child class. This is called overriding. The attribute of the parent class is said to be overriden when this attribute is redefined in a child class.
Once you add an attribute to a class, you can only modify the initial value of the attribute. You cannot modify other attribute properties.
To add an inherited attribute to a class:
- Double-click a class that is linked to a parent class in the diagram to open its property sheet, and then click the Attributes tab.
- Click the Inherited button to open the Inherited Attribute window. This window lists all the attributes that belong to all the parent classes of the class.
- Select an attribute and click Override and then Close. A copy of the attribute is added to the list of attributes of the child class. It is grayed to indicate that its properties cannot be modified, and its stereotype is set to <<Override>>.
- Click OK.
Copyright (C) 2006. Sybase Inc. All rights reserved.
|
|