Manage class implementations
Learn how to implement classes using specialized techniques like static classes, partial classes, and object initializers that can improve the readability, maintainability, and organization of your code.
Learning objectives
After completing this module, you'll be able to:
Describe the differences between structured and object-oriented programs, the benefits of encapsulation, and the lifecycle of a class.
Restrict access to classes and members using private, static, and nested classes.
Improve code organization and maintainability using partial classes.
Improve code readability and maintainability using methods that implement named and optional arguments.
Improve code efficiency and readability using object initializers and copy constructors.
Explain the purpose of a class finalizer and the relationship between a finalizer and the garbage collector in .NET.
Prerequisites
The ability to create classes and class constructors to instantiate objects in a C# app.
The ability to implement class properties using property accessors and access modifiers and methods or extension methods that support overloading.
The ability to develop C# console apps that implement business logic using iteration statements, selection statements, and custom methods.
The ability to perform basic C# code debugging and exception handling in a Visual Studio Code environment.