• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Exploiting the Power of Clas... > Building Hierarchies of Classes

Building Hierarchies of Classes

It is common to emulate real-life relationships between objects in the classes that you build. This necessitates the building of a class hierarchy. The relationships that you build between classes make up an object model. For example, you might have a Client class that has multiple Order objects associated with it. Each individual Order object can then have multiple Order Detail objects associated with it.

To relate one class to another, place a declaration of the child class in the General Declarations section of the parent. For example, the Order class contains the following declaration:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint