.Net Developer
Connected Tutorial(This question is a follow-up to this tutorial):
What is Abstraction in OOPS?In object-oriented programming, abstraction is often defined as “hiding internal complexity and exposing only essential features.”
But in real-world software development, we mostly use abstraction to:
Define a common base class or interface, and
Allow different implementations to be used interchangeably via that common contract.
For example, I might have a PaymentProcessor
interface that both StripeProcessor
and PayPalProcessor
implement — so my code can depend on the abstract PaymentProcessor
, not the specific implementation.
But here, I’m not really “hiding complexity” in the sense that the main goal is not to simplify the interface for an end user — it’s to make the system extensible and loosely coupled.
So my question is:
Shouldn’t we define abstraction more in terms of creating common interfaces for interchangeable behavior, rather than just “hiding complexity”?
Or — is “hiding complexity” still the right definition, but just a broader one that includes these use cases?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
You’re still hiding complexity, just at a different level.
When you use an interface like PaymentProcessor
, you’re keeping the rest of your code from caring how Stripe or PayPal actually works.
That’s the whole point of abstraction. It’s not just about simplifying things for users, but also about keeping systems flexible and decoupled.
So yeah, “hiding complexity” still fits, it just applies in a broader sense than most tutorials explain.
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.