An abstraction mechanism is any feature of a programming language that allows the programmer to create his solution in a way that is more intuitive and relates as closely as possible to the real-world problem. (It's abstract from the code, and close to the real-world problem).

In Object Oriented programming languages, this is done through the creation of classes. A class is a concept or thing which can be clearly abstracted as a part of the solution. It should encapsulate everything the program knows about or can do to this concept or thing. Operator overloading, templates and inheritance are all abstraction mechanisms - they allow us to deal with the concepts and things in a program in a high-level way, without thinking about what's going on underneath.

This is why classes should always be designed from the interface in - the closer they get to the concept or thing they represent the better. The user (programmer) need not know what's going on underneath, he just needs to know that it does as it's told.

Log in or register to write something here or to contact authors.