Skip to content
Definition
Abstraction is a fundamental concept in computer science that involves simplifying a problem by removing unnecessary details, allowing us to focus only on the essential aspects. This process helps in creating a model or representation that is easier to work with and understand.

Types of Abstraction

Key Point
Type of abstractionWhat it doesTypical example
Representational abstractionRemoves irrelevant detail from a modelA map that shows roads but not every building interior
Abstraction by generalisationFinds common patterns to use one shared solutionTreating dogs/cats/birds as Animal objects
Data abstractionHides storage/implementation details behind an interfaceUsing a stack without knowing its internal structure
Procedural abstractionBreaks problems into reusable procedures/functionsCalling calculateTotal() without knowing internals
Worked Example
Levels of Abstraction Example
LevelTypical focusExample in an email app
High level (user interface)What the user sees and doesClick "Send" button
Middle level (program code)How behaviour is implementedsendEmail(to, subject, body)
Low level (hardware/machine)How instructions execute physicallyCPU executes machine instructions
Each level serves a different purpose, from user interaction down to hardware execution.