First
Previous
Next
Last
Index
Home
Text
Slide 28 of 38
Notes:
There are two important categories of classes:
Value based classes (which can be copied, and instances are distinguished by value), and
Reference based classes (for these a pointer or reference to the class is copied and instances have an identity rather than a value).
There are other categories, but the Whole class I’ve been using is definitely a value based class.
OTOH issues with base classes are more frequent with referenced based classes supporting a polymorphic hierarchy.
It is very rare to derive a class from a value based class, it is even rarer for it to be a good design decision.
To avoid introducing a new example I’m going to extend Whole.