Abstraction

Abstraction is the ability to work with the concept/idea while safely ignoring some of its details. Rather, handle different details at different levels.

Take an example of a simple fan regulator. As a consumer of it, I can focus only on regulating the speed. Here, changing the speed via the interface (knob) is the concept while I will ignore other details like an internal electronic circuit that consists of a diode, capacitor, resistors, DIAC, TRIAC and so on..

Internal of the fan regulator.

Thus, Abstraction is the process of showing only the relevant details with which consumer can safely work with.


Real-life analogy

When we consider a laptop as aggregate, it is an abstraction of its various parts, like a keypad, touchpad, screen, motherboard, hard-disk, processor, etc.

Similarly, A keypad as a whole, in turn, is an abstraction of a particular arrangement of keys and internal wirings.

This way, abstraction allows you to take a simpler view of a complex concept.


Similarly, in software development, abstraction should manage the complexity of the software design at a different level. A good abstraction should lead to a good (less complex) software design.

In languages like C++, Java, C#, we can achieve abstractions via abstract class and interface.

Good programmers create abstractions at the method level, class level, interface level, namespace level, and assembly level —in other words, motherboard level, keypad level, and laptop level—and that supports faster and safer programming.

As programmers, we need to provide the right level of abstraction in accordance with the need of the end consumer.

8 responses to “Abstraction”

  1. priyanshu Avatar
    priyanshu

    very nice and easy explaination

  2. Ameya Avatar
    Ameya

    Nice one !! 🙂

  3. Saurabh Junankar Avatar
    Saurabh Junankar

    Good post buddy.Very nice and self explanatory.Please post on encapsulation and difference between these two.

  4. Mangesh Avatar
    Mangesh

    The laptop example is easy to understand. Hope to see more posts soon.
    Also as a suggestion, please include relevent code samples wherever necessary. Most software engineers read c# n java better than English 🙂

  5. Kiran Tate Avatar
    Kiran Tate

    Agreed!!

  6. Nitya Avatar
    Nitya

    Easy and effective explanation. Great post!

  7. Deepali Avatar
    Deepali

    Nice one

  8. Dilip Avatar
    Dilip

    Nice post

Leave a Reply

I’m Datta

Welcome to BeingCraftsman — where software architecture is treated as a long-term responsibility. I’m a Software Architect and Cloud Lead based in Pune, India, with over a decade of experience designing scalable systems, guiding teams, and making practical engineering decisions. This space is about clarity in architecture, reliability in systems, and leadership that helps teams build software that lasts.

Let’s connect

Linkedin

Discover more from Being Software Craftsman (DFTBA)

Subscribe now to keep reading and get access to the full archive.

Continue reading