Lecture overview -- Keyboard shortcut: 'u'  Previous page: Examples of Static Factory Methods -- Keyboard shortcut: 'p'    Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 29 : 29
Object-oriented Programming in C#
Reference types, Value types, and Patterns
Privacy Leaks

Problem: A method can return part of its private state, which can be mutated outside the object

/user/normark/oop-csharp-1/sources/c-sharp/privacy-leaks/1-without-properties/date.csA Mutable Date class. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/privacy-leaks/1-without-properties/person.csA Person class that can return its private date of birth. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/privacy-leaks/1-without-properties/Client.csA client of the Person which modifies the returned birth Date. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/privacy-leaks/1-without-properties/outputThe output of the Person client program.


Go to exercisePrivacy Leaks
Go to exerciseMutable and immutable Point objects with Move methods
Go to exercisePyramid BankAccounts