D. The Fragile Base Class Problem

Many object-oriented languages suffer from what is called the fragile base class problem. If you add methods or instance variables to a class, you must recompile any classes that derive from the changed class. This is probably of no consequence for classes that you create in your own application code. Good practice requires that you make a clean compile before you release your program. But it is a problem for framework providers. For example, many of the classes in the Cocoa frameworks are intended to be subclassed. Imagine if you had to recompile all of your programs every time Apple wanted to change something in a Cocoa framework class. You (and everybody else) would also need fresh copies of any programs you ...

Get Learning Objective-C 2.0: A Hands-on Guide to Objective-C for Mac and iOS Developers, Second Edition 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.