Previous | Next | Table of Contents | Index | Program List | Copyright

CHAPTER 15

Programming with Objects: Tagged Record Types


15.1 System Structures: Object-Oriented Programming
15.2 System Structures: Tagged Types
15.3 Data Structures: General Access Types
15.4 System Structures: Class-wide Types
15.5 System Structures: Dynamic Dispatching
15.6 Heterogeneous Linked Lists
Chapter Review

The variant records we studied in Chapter 12 provide much expressive power to create complex types with several different parts. However, they have an important limitation: A variant record must be fully defined and compiled, and CASE statements are used to control processing its various parts.

In this chapter we look at tagged types, a generalization of variant records that allows new variants to be added without recompiling the packages in which the original variants are declared. Tagged types implement type extension, a kind of inheritance. Inheritance is an important concept used in many object-oriented programs.

We also discuss general access types, a generalization of the access types in Chapter 14. General access types allow the programmer to create a pointer to a statically declared variable, not just a dynamically allocated block. The combination of general access types and tagged types gives a very interesting and powerful style of object-oriented programming.


Previous | Next | Table of Contents | Index | Program List | Copyright

Copyright © 1996 by Addison-Wesley Publishing Company, Inc.