Abstraction is simplifying difficult reality by modeling classes suitable to the problem, and working at the most apt level of inheritance for a given aspect of the problem.
Abstraction is as well achieved through Composition. For instance, a class Car would be made up of an Engine, Steering objects, Gearbox, and many more components. To build the Car class, one does not require to know how the different components work internally, however only how to interface with them, i.e., send messages to them, get messages from them, and perhaps make the different objects composing the class interact with each other.
0 comments:
Post a Comment