In copy by reference, the content of the existing element is simply referred to from a
new place. Any later changes to the element are thus visible in both places where it is
used.
The advantages and viable use cases for these different methods should be clear, at
least for this limited, abstract view. Taking a wider view and demanding more details
reveal some extra complexities.
15.1.2 Names and Copy by Reference
First, how do we actually make a reference to the existing element? The traditional
method from coding has been to give the element a name. More precisely, the name is
a sequence of characters that serves to uniquely identify a particular element in the
contexts in which the name is found. This introduces a distinction between the place
where the element is de?¬?ned and where it is used: the de?¬?nition includes the name and
the content, the uses include just the name, or to be precise, the same sequence of
characters.
The content of the element thus remains pure and simple: it exists in one place, so
everything just works. The name of the element however exists in two or more places
in the system. If the name is changed in one place, the same change must be applied to
all other places, if the references are to remain intact. Ideally, this support would be
provided automatically. This can prove to be surprisingly dif?¬?cult: there may be no
easy way to ?¬?nd all such places; in more complex cases, it may even be practically
impossible.
Pages:
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767