Reference types, Value types, and Patterns
- slide 29 : 29
Privacy Leaks
Problem: A method can return part of its private state, which can be mutated outside the object
A Mutable Date class.
A Person class that can return its private date of birth.
A client of the Person which modifies the returned birth Date.
The output of the Person client program.
Privacy Leaks
Mutable and immutable Point objects with Move methods
Pyramid BankAccounts