Introduction to OOP
Chapter 12: Implications of substitution:
We have explored the implications that result from the inclusion of the principle of substitution in an object oriented programming language.
Because values are not known until run time, you either have complex semantics (as in C++) or objects are dynamic (as in Java and most other languages).
Because objects are dynamic, most object-oriented languages end up using a garbage collection system.
Dynamic semantics naturally lean to pointer semantics for assignment
Pointer semantics mean that equality and identity are two different concepts
Since equality is domain specific, the programmer must be free to redefine the meaning as appropriate
Because the programmer can redefine equality arbitrarily, there is no guarantee that semantics of equals is preserved.
, Slide 21