Abstraction in C#

Problem
You want to know the purpose of abstraction and how it differs from encapsulation.

Solution
Abstraction allows developers to model their problems at higher levels. This way, they don’t have to worry about the implementation details of a type. Encapsulation is used to hide implementation details of a type from clients. Clients can be code or people that use the encapsulated code. Abstraction is related to encapsulation, but they are not the same. Abstraction is the process of generalization.

Comments
Remote controls are real-world examples of abstraction and encapsulation. The operations a remote can perform are abstractions, while the device itself provides encapsulation.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s