Advanced PowerBuilder

HomePrevious Lesson: Inheriting Menu Objects
Next Lesson: Encapsulation in PowerBuilder

Multiple Inheritance

PowerBuilder doesn't directly support multiple inheritance. For example, to inherit properties and functionality for a window, from two other windows, you need to workaround using user objects. Instead of building functionality in two windows, you divide the functionality and create a window and a user object. When you create your window, you need to inherit from the window and place the user object in the descendant window to get the required functionality.

We can use our vehicle analogy to show the difference between a traditional implementation of multiple inheritance and PowerBuilder's implementation.

Traditional Implementation of Multiple Inheritance

PowerBuilder's Implementation of Multiple Inheritance

The emergency vehicle user object is placed in the fire engine object to give it the functionality of both an emergency vehicle and a truck.
HomePrevious Lesson: Inheriting Menu Objects
Next Lesson: Encapsulation in PowerBuilder