English
Topic 8. Encapsulation, access modifiers, and static class members
Goal: become familiar with the principle of encapsulation, access modifiers, and static members of C# classes; learn to design classes with hidden state and invariants and to use static fields, methods, constructors, and classes, as well as factory methods; master creating a solution with a class library and the internal modifier.
Lecture contents
- Encapsulation and access modifiers — Encapsulation · Access modifiers · The assembly as an access boundary
- Protecting state and readonly fields — Protecting object state · const, readonly, and static readonly fields
- Static members and namespaces — Static members · Factory methods and private constructors · Namespaces and project organization
- Examples and common mistakes — Example programs · Common mistakes