Chapter 3 Building Structural Diagrams


Overriding an attribute in PowerBuilder

The Inherited Attributes dialog box allows you to:

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.

Steps To add an inherited attribute to a class:

  1. 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.
  2. 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.
  3. 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>>.
  4. Click OK.

 


Copyright (C) 2006. Sybase Inc. All rights reserved.