namnv
namnv

Reputation: 49

What is the correct definition of 'abstract' in OOP?

I am trying to understand the definition of 'abstraction' in OOP.

I have come across a few main definitions. Are they all valid? Is one of them wrong? I'm confused.

Definition 1:
Abstraction is the progress of modeling real-world objects into programming language
Abstraction is not about interfaces or abstract classes.
Abstraction is the progress of modeling real-world objects in the programming language.
Hence interfaces and abstract classes are just two techniques used in this progress.
In an Object-Oriented Programming language like Java, everything is an abstraction: interface, class, field, method, variable, etc.

Abstraction is the fundamental concept on which other concepts rely: encapsulation, inheritance, and polymorphism

Definition 2: Abstraction is one of the key concepts of object-oriented programming (OOP) languages. Its main goal is to handle complexity by hiding unnecessary details from the user. That enables the user to implement more complex logic on top of the provided abstraction without understanding or even thinking about all the hidden complexity.

Upvotes: 0

Views: 1191

Answers (4)

MBen
MBen

Reputation: 49

[Purifying] is not means [Abstraction], Purifying is the important rule of Inheritance Pillar

[Hiding] is not means [Abstraction], Hiding is the important rule of Encapsulation Pillar
--------
—> Hiding or Purifying or Covering or Encapsulating Never = Abstraction <—

The First Definition is the Correct Answer: Abstraction is the progress of modeling real-world objects in the programming language.
—<< Abstraction = Classes = Blueprints = Modelling some Objects>> —
Abstraction is the first Step Rule & Pillar of OOP Pillars…
--------
wich means [Classes and Interfaces] …

[Abstraction] is not more than a [Modelling] …

in general:

A home Construction Engineer cannot start Constructing any home without a Blueprint !!

Abstraction =>> ( it’s the first Step into OOP ) and ( the Pillar of All Pillars )

without Abstraction there is no Classes no Interfaces no Abstract Classes and Automatically no Objects..
----------
=> (no Classes[Abstraction] no Objects[REAL THINGS] !!)

Upvotes: -1

sanurah
sanurah

Reputation: 1132

Definition 1 doesn't exactly explain abstraction. Process of modelling real world objects to programming languages is called OOP. Abstraction is a OOP concept.

Definition 2 does a better job at explaining abstraction.

But it's better to understand the concept in your own thoughts and words.

Think about the meaning of the word abstraction in english. It's defined as "the quality of dealing with ideas rather than events". In OOP it's similar, abstraction is a concept where you show only relevant data and conceal unnecessary details of an object from the user.

Upvotes: 0

Stephen C
Stephen C

Reputation: 719316

Both definitions are valid. The differences between the definitions are largely due to the context. The first is about the role of abstraction in modelling. The second is about the role of abstraction in programming.

My advice is to not get hung up on looking for the "correct" definition. These terms have a range of meanings and interpretations. And there is no official arbiter to tell you which definition is correct. This is NOT mathematics ...

Upvotes: 3

Henry
Henry

Reputation: 43778

Definition 1 is too narrow. "modeling real world objects into programming language" can be regarded as abstraction (although I would rather use the term modeling here), but there are many more forms of abstraction.

Definition 2 is better.

Upvotes: 1

Related Questions