What is Abstraction?
Abstraction in OOP allows information/access about how codes are applied to be concealed, allowing just the required access. These details may be found in the object definitions. A famous example is the counting approach that works with list items. One thing to keep in mind is that, given the same OOP concept, all Python I data types and structures are objects. In this sense, a list is a class that has methods for completing tasks.
What is the Function of Abstraction?
Abstraction use simpler high-level instruments to get access to a complex object:
- Using simple things to represent complexity
- Hide complex details from user
Abstraction also serves a significant security role. We only present selected data items and provide data access via classes and methods to protect the data from being exposed. In the case of an automobile, an open gas tank would make it impossible to continue driving.
There are some benefits of abstraction which is mention below:
- Simple, high level user interfaces
- Complex code is hidden
- Easier software maintenance
- Code updates rarely change abstraction