A Review of OOP Concepts

What's OOP?

Object Oriented Programming or simply OOP is a way of programming in which you think of Objects and the interrelated methods, functions or properties that each object must contain.

There are four important concepts behind Object Oriented Programming these are Abstraction, Encapsulation, Polymorphism and Inheritance.

Abstraction
It the process of modelling wherein only the needed or the important functions of a class are shown and hide the inner workings to lessen the complexity.

Encapsulation
Often referred to as information hiding, encapsulation hides data from external access, in C#  access is given through access modifiers such as public, internal and protected.

Polymorphism
Is simply having many forms and shapes, you may ave many classes which can be used interchangeably, in .Net polymorphism is implemented through interfaces.

Inheritance
is the ability to create a new class from existing base class, parent class are called base class and the class the inherits from the base class is called derive class. In .Net C# multiple inheritance is not allowed.

What about Associations, Compositions and Generalizations, Aggregation these are relationships between objects in OOP.

Let's discuss this more, since this is a bit confusing and needs to be recalled.

Associations
Association is a (*a*) relationship between two classes, where one class use another.

Composition
(*has a*)

Comments

Popular posts from this blog

Serializing JSON string to ExpandoObject

Adding an Obsolete Attribute to Class Methods in C#