Abstraction
the mechanism and practice through which details can be reduced and factored out so that one can focus on a few concepts at a time.
Encapsulation
the packaging of data fields and behaviours into a single unit (class) so that implementation details are hidden
Inheritance
-Classes can exist in a hierarchical structure where classes higher up are more general and classes lower down are more specific
-A way to form new classes, using classes that have already been defined.
Inheritance is employed to reuse existing code with little or no modification.
Types of inheritance
-Single inheritance
-Multiple inheritance
-Hierarchical inheritance
-Multilevel inheritance
-Hybrid inheritance
-Implicit inheritance
Single inheritance
Inheritance from a single base class
Multiple inheritance
When a class inherits from more than one parent class
Hierarchical inheritance
When a base class has more than one subclasses
Multilevel inheritance
Inheritance from a class thats already inheriting from another class
Hybrid inheritance
A combination of inheritance types
Implicit inheritance
all classes in C# inherits from the System.Object
class and its derived classes and therefore inherit its members, such as ToString().
Polymorphism
The ability of a program to detect the actual class of an object and call its implementation even when it is declared as in instance of a parent or abstract class or interface.
Static polymorphism
-It is decided at compile time
-It is achieved with method overloading
Dynamic polymorphism
-It is decided at run time
-It is achieved with method overriding
Types Access modifiers
-Private
-Protected
-Internal
-Protected internal
-Public
Private
Access is restricted to the same class where the member is defined.
Protected
Accessible from within the class where it is defined and in all classes that inherits from that class
Internal
Accessible from anywhere in the assembly
Protected internal
Accessible from anywhere in the same assembly as well as derived classes in another assembly.
Public
Accessible from anywhere in the system
A property
A private data field with one or two private or public methods and the so called getter and setter (accessors):
Composition
occurs when the contained object has right of existence only when it is part of the container
Aggregation
A special type of association where the instance of the client class can contain one or more instances of another class
An association
A relationship between two (or more) types that are linked by an instance(s).