Types of Abstraction
| Type of abstraction | What it does | Typical example |
|---|---|---|
| Representational abstraction | Removes irrelevant detail from a model | A map that shows roads but not every building interior |
| Abstraction by generalisation | Finds common patterns to use one shared solution | Treating dogs/cats/birds as Animal objects |
| Data abstraction | Hides storage/implementation details behind an interface | Using a stack without knowing its internal structure |
| Procedural abstraction | Breaks problems into reusable procedures/functions | Calling calculateTotal() without knowing internals |
| Level | Typical focus | Example in an email app |
|---|---|---|
| High level (user interface) | What the user sees and does | Click "Send" button |
| Middle level (program code) | How behaviour is implemented | sendEmail(to, subject, body) |
| Low level (hardware/machine) | How instructions execute physically | CPU executes machine instructions |