Appendix A. Leftovers: The Top Ten Topics (we didn’t cover)

image with no caption

Believe it or not, there’s still more. Yes, with over 550 pages under your belt, there are still things we couldn’t cram in. Even though these last ten topics don’t deserve more than a mention, we didn’t want to let you out of Objectville without a little more information on each one of them. But hey, now you’ve got just a little bit more to talk about during commercials of CATASTROPHE... and who doesn’t love some stimulating OOA&D talk every now and then?

Besides, once you’re done here, all that’s left is another appendix... and the index... and maybe some ads... and then you’re really done. We promise!

#1. IS-A and HAS-A

Lots of times in OO programming circles, you’ll hear someone talk about the IS-A and HAS-A relationships.

IS-A refers to inheritance

Usually, IS-A relates to inheritance, for example: “A Sword IS-A Weapon, so Sword should extend Weapon.”

image with no caption

HAS-A refers to composition or aggregation

HAS-A refers to composition and aggregation, so you might hear, “A Unit HAS-A Weapon, so a Unit can be composed with a Weapon object.”

image with no caption

The problem with IS-A and HAS-A

The reason we haven’t covered IS-A and HAS-A much is that they tend to break ...

Get Head First Object-Oriented Analysis and Design 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.