Overview of NewtonScript Inheritance

Comparing Prototype Inheritance and Class-Based Inheritance

As we said before, NewtonScript inheritance differs from the class-based inheritance found in languages such as C++, Smalltalk, and Object Pascal. In class-based inheritance, one class inherits from another class, and objects are created as instances of a class.

Difference (or prototype) inheritance has some advantages over class-based inheritance:

The major disadvantage is speed. Accessing a slot requires searching an object and then searching its entire inheritance chain. In class-based inheritance, accessing a slot can be done in one operation. Remembering the design requirements of the Newton, the size versus speed trade-off was preordained.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996