Provide a read-only interface to a mutable object.

Participants

The safest read-only protection is obtained by making the Mutator class a private Java nested class of or C++ friend of the PrivilegedClient class. Then there is no need for a setter method - PrividgedClient can directly access the attribute instance variable. This only works when PrivilegedClient constructs the Mutable objects. This is the most common case.