Assignment by Value and by Reference

Assignments can be made either by reference or by value. For an assignment by reference, the entity to which the assignment is made refers to the entity being assigned. In other words, subsequent changes to the entity by either the new or existing reference is reflected in both places (there is only one entity; it isn’t copied). However, for a by value assignment, a copy of the assigned entity is made, and that is what is applied to the entity receiving the assignment. This results in two independent objects. Therefore, changes in one place do not affect the other.

Assignment Conventions
Assignment to... ...of type... ...behaves as follows:
Business Object attribute or composition BOM Native or Primitive Type (except Date, Time, DateTime) Effectively by value.

For efficiency’s sake, objects are only copied where they are mutable (where their internal value can be changed). In other words, by reference behavior is sometimes used, but always behaves like by value. See BOM Native Type or Primitive Type Object to Business Object Attribute.

BOM Class By reference.

Important note: Two BOM attributes can be programmatically set to refer to the same object instance, and the changes are reflected in both places. However, once the script is complete, the data s stored and that single value is stored and, thereafter, behaves as two independent objects.

Process Data Field BOM Class By reference. See Assigning a Business Object.
Basic Type (except Date, Time, DateTime) By value. See Assigning a Basic Type Object to a Process Data Field.