Chapter 21

Structural Inheritance

Circles ain’t redEllipses ain’t blueLemons ain’t sweetAll this is true

—Anon.:Where Bugs Go

This chapter is based in part on Appendix G (“A Closer Look at Structural Inheritance”) of the Manifesto book. However, all of the material is revised here, sometimes extensively.

The inheritance model described in Parts II-IV of this book is concerned with what’s often called behavioral inheritance, on the grounds that what’s inherited is “behavior” (i.e., operators). But there’s another kind of inheritance as well, so called “structural” inheritance, where what’s inherited is representations. Now, I claimed in Chapter 3 that those inherited representations were physical representations specifically (so long as the types involved were scalar types, at any rate); however, I did also say that some might disagree with that claim, and I’ll examine it more closely in what follows (actually in the next section). I also mentioned in that same chapter something called “the EXTENDS relationship,” which is a form of structural inheritance in which the representations involved are explicitly visible to the user. This chapter investigates such matters in depth.

The plan of the chapter is as follows. The section immediately following these introductory remarks takes a look at a simple example, with a view to exposing the real issues underlying the idea of structural inheritance. The next section considers what might be involved in supporting that idea. The subsequent ...

Get Type Inheritance and Relational Theory now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.