Please enable JavaScript.
Coggle requires JavaScript to display documents.
C#-OOP - Coggle Diagram
C#-OOP
INTERFACES
What
Build
Loosely-Coupled
Application
In-C#
Prefixed-I
public
interface
IClassName {..}
int Method();
UnitTesting
Requires
Isolation
Implementing
public class
NewClass :
INewClass, IOtherClass
Extensibility
Passing
Interfaces
As-Args-Of
Ctor
Methods
Not-For
Multiple
Inheritance
Polymorphism
Methods
Implemented
Differently
INHERITANCE
Modifiers
Access
Private
Public
Protected
Accessible
Child
Internal
Accessible
Same-Assembly
Protected-Internal
Accessible
Or-Same-Assembly
Child
Assembly
Adding
RC-Solution
Add > NewProject
ClassLibrary
GiveName
Referencing
RC-References
Add ref
Project/Solution
SelectProject
Ctor
BaseClass
Ctor
ExecuteFirst
Not-Inherited
Calling
public Child(var) : base(var) {..}
Casting
Upcasting
Child -> Parent
Implicit
Downcasting
Parent -> Child
Explicit
childObj =
(Parent)parentObj
InvalidCastException
parentObj as Child
SetNull
TypeCheck
if (obj is Car)
Boxing
ValueType -> Obj-Reference
object obj = 10
Unboxing
int x = (int)obj
Performance
Penalty
Avoid
Passing
ValueType
As-objParams
POLYMORPHISM
Overriding
Parent
public virtual
void Draw()
Child
public override
void Draw()
Abstract
Indicates
Missing
Implementation
Parent
public abstract void Draw();
abstract class Parent
Child
public override void Draw()
Sealed
Prevents
Derivation
Class
public sealed Shape
Overriding
Methods
Of-Child
public sealed
override
Draw()
Slightly-Faster
Runtime
Optimizations