Copy Constructor vs the Encapsulation Boundary

From CSSEMediaWiki
Jump to: navigation, search

In choosing Object Encapsulation over Class Encapsulation we encounter problems implementing methods such as Java's equals(). Another standard idiom that appears to be incompatible with Object Encapsulation is the Copy Constructor. This page is designed for discussion about whether Copy Constructor is a useful idiom in the first place, and if so, how to design it in a clean way in the presence of Object Encapsulation.

See Also

Equals vs the Encapsulation Boundary

Personal tools