Abstraction Definition :
In very simple words Abstraction is concept of hiding complexity of a system and showing only necessary details to its user. So user can access the necessary functionalities easily without thinking of internal complexity of the system. Abstraction mainly focuses on outside view or design of the system.Real world Example : We can take Keypad mobile as real world example , where you see and use display screen , keypad and speaker but you can not see how it is internally connected keypad,screen each other using circuits inside mobile, because internal connection programming is not required to user.
Note : Abstraction intention is to decrease complexity by showing essential feature and hide internal implementation , most of the People thinks this is to implement security in application that is not 100% correct since you can implement security in implementation class if required.
Features of Abstraction in OOP's
Highlighting Essential Features:
Abstraction allows the developer to expose only the relevant attributes and methods of an object that are necessary for the client (user of the object). This makes it easier for the client to interact with the object without being overwhelmed by unnecessary details.
Hiding Implementation Details:
By hiding the complex implementation details and exposing only what is necessary, abstraction simplifies the interaction with the object. This helps in managing complexity and makes the system easier to understand and use.
Reducing Complexity:
Abstraction helps in breaking down complex systems into simpler, high-level components. This makes it easier to manage and maintain the system.
Improving Modularity:
By defining clear and simple interfaces, abstraction promotes modular design. Each module or component can be developed, tested, and understood independently.
Enhancing Maintainability:
With abstraction, changes in the implementation of an object do not affect the code that interacts with it, as long as the interface remains consistent. This improves maintainability and allows for easier updates and modifications.
Encouraging Reusability:
Abstract classes and interfaces define common behaviors that can be reused across different parts of the application or even in different projects. This reduces duplication and promotes code reuse.
Other Definition
Abstraction in OOP is about managing complexity by exposing only the necessary details to the client and hiding the implementation details. While it is not primarily about security, it does contribute to a more secure and robust system by encapsulating the internal workings and reducing the risk of unintended interactions.
Video Reference :
https://www.youtube.com/@ASP4UT
https://www.youtube.com/@ASP4U
No comments:
Post a Comment
Thanks for the contribution, our team will check and reply back if response required.