One of the most powerful features of PowerBuilder is inheritance. It enables you to build windows, user objects, and menus that derive from existing objects.
Using inheritance has a number of advantages:
-
When you change an ancestor object, the changes are reflected in all the descendants. You do not have to make manual changes in the descendants, as you would in a copy. This saves you coding time and makes the application easier to maintain.
-
The descendant inherits the ancestor's scripts, so you do not have to re-enter the code to add to the script.
-
You gain consistency in the code and objects in your applications.
This chapter describes how inheritance works in PowerBuilder and how to use it to maximize your productivity.
Opening ancestors and descendants
To enforce consistency, PowerBuilder does not let you open an ancestor object until you have closed any descendants that are open, or open a descendant object when its ancestor is open.