Page 29 : 29
Object-oriented Programming in C#
Reference types, Value types, and Patterns
* Reference Types
Illustration of variables of reference types
Overview of reference types in C#
Comparing and copying objects via references
Equality in C#
* Value Types
Illustration of variables of value types
Structs in C#
Structs and Initialization
Structs versus classes
Examples of mutable structs in C#
Examples of immutable structs in C#
Boxing and Unboxing
* Organization of C# Programs
Examples of Program Organization
Namespaces and Visibility
Namespaces and Assemblies
* Patterns and Techniques
Object-oriented Design Patterns
The Singleton pattern
A Singleton Random Class
Examples of Static Factory Methods
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.
Mutable and immutable Point objects with Move methods