J
James Kanze
The contact record does exist and a class managing the contact
record must keep track of the state of the record, it is not
read-only. For example, if a user changes the contact record
a notification of the change is received. Like the bank
account, we do not want to edit a copy of the contact on the
stack. So on this basis contact has reference semantics?
Agree?
That's what it sounds like. My example was, of course, overly
simple, and the issues may be more complex, but in general, if
you're modifying a record in different places, the type of the
record should generally have identity, i.e. not be assignable or
copiable.
In addition, due to the fact that we only want to maintain one
copy of each contact, we should disable copying and access the
individual objects via reference?
Exactly.