Abstraction in C#
Abstraction in C#: Abstraction in C#: an overview, Inheritance Review, Adding Abstraction, Summary.
Updated
- Abstraction in C#: an overview (Apprentice): In code, abstraction means working with an object through the few things that matter to you, and ignoring the rest. Base classes already do this; abstract classes and interfaces take it further.
- Inheritance Review (Apprentice): A quick look back at inheritance in C#. A derived class names its base class after a colon, inherits its members, adds its own, and overrides the base class's virtual methods.
- Adding Abstraction (Journeyman): Mark a base class abstract when it's too general to create on its own. An abstract class can't be created with new, and its abstract methods have no body, so every concrete derived class must override them.
- Summary (Journeyman): Abstraction is a goal; the abstract keyword is one C# tool for reaching it. Choose an ordinary, virtual or abstract method by whether derived classes keep, may change or must write it.