Friday, March 12, 2021

Concept of Abstraction in OOPS


Concept of Abstraction in OOPS

 * There may be a lot of data present within a class but the user using the system application may not need the entire data present within a class. The user requires only some part of the available data in the Class. In the following case, one can hide the unnecessary data from the user and expose only those data that is of interest to the user . This concept is called as Abstraction.

 * A good example for depicting the concept of Abstraction is that of a Car. Any Car would have some parts like Engine , Radiator , Battery , Mechanical and Electrical Equipment etc .

 * The user of a car ( driver ) should know how to drive a car and the driver may not require any knowledge of the parts of the car . For example , a driver is never bothered about how the engine is designed and the internal parts of the engine . This is the main reason why the car manufacturers hide their parts from the driver in a separate panel which is generally at the front part of the car .

 * The sole advantage for usage and putting into practice the concept of Abstraction is that every user would be able to get their own view of the data according to their own requirement and the user will not get confused with so much unnecessary data .

 * A Bank Clerk should only see the customer details like Account Number , Name and Balance Amount within an account . He should not be entrusted with access into sensitive data like the staff 's salaries , profit or loss of the bank , interest amount paid by the bank , loan amount to be recovered etc . Therefore , sensitive data should be abstracted from the Clerk's view . The Bank Manager however may require the sensitive data and thus it could be provided to the Bank Manager .

 

No comments:

Post a Comment