Retail Application-Activity
Consider the Retail store application:
When a customer goes to purchase a television for example, what are the details given by the salesperson about the television?
Characteristics of the television (model, make, color etc)
Basic functioning of the television
What are the details which are not mentioned by the salesperson ?
The internal components (resistors, switches etc)
How the internal components are wired and how they work
Let us identify the OO concept discussed here
ABSTRACTION : Process of identifying the essential details to be known and ignoring the non-essential details from the perspective of the end user
ØDefined as the process of focusing the essential details and ignoring the non-essential details
§Helps simplify the understanding and using of any complex system
–Ex. The driver of a car needs to know how to apply brake, change gear and balance the steering. The driver need not know how the engine works
The process of focusing on the relevant details and ignoring the irrelevant details is called Abstraction. Abstraction is not an entirely new concept introduced by OOP. Structured Programming also supported abstraction with the help of data structures and functions. For example, one need not know the internal details of the printf function of C to use it. One need not know about how characters are converted to ASCII code and stored in the memory for using a character array.
OOP provides better abstraction. While structured programming provides abstraction at the level of data structures and function, OOP provides abstraction at a higher level. Higher the abstraction level easier it is to understand.
我的理解:
一个对象,对于实际开发来将,包括有用的信息和没有用的信息,抽象就是提取出重要的信息,忽略不重要的信息。
这个概念没有什么好说的。
举例说明!