Mid GoF Patterns

Deep vs. Shallow Cloning:?

  • The example above demonstrates shallow cloning, where only the primitive

properties are copied. If the object contains references to other objects (e.g.,

arrays, lists), you may need to implement deep cloning to ensure that

referenced objects are also cloned, not just referenced.

More from Design Patterns in C#

All questions for this course