I see abstraction in processes. I see abstraction in data.
I see that abstraction is losing the unimportant details.
I see that abstraction is giving a group of elements a name and treating them as one unit. (But I don't know why that is considered abstraction. So, please I need clarification on this particular point)
I know there are also levels of abstraction, and although the name implies something, I don't have a practical example, and I can't think of a specific one I'm confused about the definition of abstraction.
Can somebody write a comprehensive article? Scratch that. Can somebody give a comprehensive answer?
EDIT:- Thank you for your answers. However, I was looking for a generalized answer. For example, I'm reading an article in which procedures are considered abstractions. However, here the answers are about abstract classes in C# and Java, (until now.) Thank you again.
Abstraction (from the Latin abs, meaning away from and trahere , meaning to draw) is the process of taking away or removing characteristics from something in order to reduce it to a set of essential characteristics.
In object-oriented programming, the open–closed principle states "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"; that is, such an entity can allow its behaviour to be extended without modifying its source code.
A cognitive process in which common elements of diverse things are identified and pulled out of their context (abstracted) in order to study them. Doing this makes it possible to classify and analyze ∗data that could not otherwise be studied together.
Abstraction is one of the key concepts of object-oriented programming (OOP) languages. Its main goal is to handle complexity by hiding unnecessary details from the user.
Abstraction is the technique of hiding implementation. At it's core there's not much more to that answer. The bulk of meaning to abstraction come from how and why it is used.
It is used for the following scenarios
Abstraction is hiding details of specific implementations and share common details among implementations. Example is java.util.List, java.util.ArrayList and java.util.Map. List is the parent (the abstraction), ArrayList and Map are specific implementation.
You want to do this whenever you have shared code between different classes, so that you don't repeat your code which is bad.
Abstraction is very useful in code reuse, dynamic behavior and standardization. For example, there is a method that you are using and it accepts a List, so to use this method, you can send any object that has list as its parent. Now inside this method, there could be different implementations depending on what is the type of the passed object, so you can achieve a dynamic behavior at run-time. This is very useful technique when you design a framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With