Abstraction in C# | Abstraction Principle in CSharp with Examples
In this video, we are going to discuss Abstraction Principle in C# with Examples. Abstraction in C# is one of the fundamental OOPs principles. As part of this video, we are going to discuss the following pointer.
1. What is Abstraction in C#?
2. Real-Time Examples of Abstraction
3. Example to Understand Abstraction Principle in C#
4. How to Implement Abstraction Principle in C#?
5. Example to Implement Abstraction Principle in C# using Interface
6. Example to Implement Abstraction Principle in C# using Abstract Class and Abstract Methods
7. Differences Between Encapsulation and Abstraction in C#
8. Advantages of Abstraction Principle in C#
What is Abstraction in C#?
The process of representing the essential features without including the background details is called Abstraction. In simple words, we can say that it is a process of defining a class by providing necessary details to call the object operations (i.e. methods) by hiding its implementation details is called abstraction in C#. It means we need to expose what is necessary and compulsory and we need to hide the unnecessary things from the outside world.
Programmatically we can define abstraction as the process of hiding implementation details of the object’s feature and showing only the essential information of the feature to the user. Abstraction lets you focus more on what an object does rather than how it does. That means what are the services available as part of the class, that we need to expose but how the services are implemented that we need to hide. Now, let us try to understand the concept abstraction principle with some real-time examples.
Real-Time Example of Abstraction
To take a real-time example, when we log in to any social networking site like Facebook, Twitter, LinkedIn, etc. we enter our user id and password and then we get logged in. Here we don’t know how they are processing the data or what logic or algorithm they are using for login. This information is abstracted/hidden from us since they are not essential to us. This is basically what abstraction is.
Another real-time example is an ATM machine. We all use the ATM machine for cash withdrawals, money transfers, retrieving min-statement, etc. in our daily life. But we don’t know internally what things are happening inside an ATM machine when we insert an ATM card for performing different kinds of operations. Information like where the server is, where the database server is, what programming language they use to write the logic, how they are validating the data, how they are implementing logic for various kind of operations, and what SQL statements gets executed on the database when we perform any operations, all these things are hide from us. What they provide as part of the ATM machine is services (cash withdrawal, money transfer, retrieving min-statement, etc) but how these services are implemented is abstracted to us.
Another real-world example of abstraction could be your TV remote. The remote has different functions like on/off, changing the channel, increasing/decreasing volume, etc. You can use these functionalities by just pressing the button. But, the internal mechanism of these functionalities is abstracted from us as those are not essential for us to know.
Another example of abstraction is when you send SMS from your mobile, you only type the text and send the message. But you don’t know the internal processing or mechanism of the message delivery system. This is nothing but abstraction.
So, in simple words, we can say that abstraction means providing the necessary details to use the services or functionalities but how the services are implemented internally that you need to hide.
The text document of this video: https://dotnettutorials.net/lesson/ab...
#abstraction #abstractioncsharp #abstractioncsharpexamples #abstractionprinciple #abstractionprinciplecsharp #abstractionprinciplecsharpexamples
Abstraction in C#
Abstraction in C# with Examples
Abstraction Principle in C#
Abstraction Principle in C# with Examples
Abstraction in CSharp
Abstraction in CSharp with Examples
Abstraction Principle in CSharp
Abstraction Principle in CSharp with Examples
C# Abstraction
C# Abstraction Examples
C# Abstraction Principle
C# Abstraction Principle Examples
CSharp Abstraction
CSharp Abstraction Examples
CSharp Abstraction Principle
CSharp Abstraction Principle Examples