0

In the realm of OOP, inheritance, abstraction and polymorphism are basic concepts of the paradigm.

On top of that, there also have the concept called "associations" which I understand is that one object associates (uses) another object. There are also specialized forms of "associations" - aggregation and composition.

What I'm really confused about is that some sites on the Internet (even some university slides) mixing all these terms and sometimes refer "Inheritance", "Polymorphism", "Abstraction" as the associations.

So the relationships between objects forming because of "Inheritance", "Abstraction" and "Polymorphism" are included in the concept of "association" (or at least in terms) ?

asked Jul 6, 2020 at 14:22
3
  • 1
    Association isn’t an OOP concept. It’s a UML concept. Commented Jul 6, 2020 at 14:46
  • 3
    I don't think the typical programmer sees inheritance, abstraction and polymorphism as forms of "association;" they see them as forms of abstraction. Commented Jul 6, 2020 at 14:59
  • Aggregation and composition are definitely more proper examples of "association." Commented Jul 6, 2020 at 15:05

1 Answer 1

2

What’s missing in your basic OOP features are not associations, but composition:

Every OOP languages provides composition. None provides association. Associations are an abstraction of the way composition is used to connect objects.

Remark: the fact of using an object is not sufficient to make an association (see discussion here). It just creates a dependency.

answered Jul 6, 2020 at 15:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.