I’ll start by saying what I always say. Almost no one knows object orientation correctly, which includes me, but I’m making a huge effort to resolve the outstanding parts. And I’ve been wearing this for about 30 years.
Almost everyone abuses of inheritance. People think that something has hierarchical relationship when it does not have. Most of objects are compounds by other objects and are not derived from other objects. And almost 100% of the examples of inheritance in books, blogs, and other sources show inheritance in something that has no hierarchical relationship (or that has but is not real), which makes almost everyone learn wrong. And the disinformation is disseminated since people are not questioning.
In this specific case the phrase was probably said in the context of Javascript that does not have the explicit declaration of types but objects that serve as prototypes for other objects. The phrase is unfortunate because it can be interpreted differently. An object access property of another object is possible in every object that has behavior, even without inheritance relation.
The actual inheritance is the hierarchical relationship, composed of the ability of the derivative type to have all that the base type has, either in implementation (subclass) or in contracts (subtype).
So one object derived from another has the same characteristics as the base object (its prototype), it’s all in it, it doesn’t have to access another object. Inheritance is done by copying. In the new derived object you can add or even change certain characteristics (not all languages allow this). If you change the characteristics, in my conception, you end the inheritance since the son is no longer able to do everything the same as the father. In the real world the heritage would be maintained, but in the computer it becomes complicated. There are those who think that the inheritance remains.
Note that we are talking about only one object, so the word "other" no longer fits there. Another concrete object is used as a model for this object, but ends the relationship between them the moment the new is created, does not have to access anything in the other. Fully dynamic languages often do this.
In class-based languages it works the same way, only the model is a plant and not a prototype, so there is no relation to another object even at the time of its creation.
Inheritance is not about classes, this is another mistake that almost everyone makes. There is inheritance without class. Outside that point the definition of AP is more correct than the article. Class is a condition of inheritance.
This has nothing to do with Association, Aggregation, Composition. These are powerful mechanisms to compose the object, but there is no direct relationship with access, this is circumstantial.
Strictly the phrase is wrong, but you can understand why. Of course, for laypeople it is a disinformation that collaborates so that most people don’t understand what OOP is, and everything that people don’t understand, but they think they do, they often go on to deify that. And everything that is deified "cannot be contested" by her or other people. So in programming we have to study up to theology :P
Some people may disagree because there are different schools than object orientation. I spoke of the one that seems to be most used. Some people take some concepts from one school and others from another school. And even impose antagonistic concepts in their conception. And I’m talking about people who are on a professional level above.
Related: What are the concepts of cohesion and coupling? (This is more important than OO, the DRY also). See also: What is a paradigm?.
Show me where you saw this
– Maniero
I believe this is not very relevant to the question, but I will add the link.
– user98628
Yeah, because if the source is a writing dummy it’s one thing, if it’s a reliable source it’s another. And the context will also indicate if it’s not a problem of interpretation.
– Maniero
It’s written exactly as I posted in the question. :)
– user98628
But in the question it is not written that it speaks of prototypes and where it is being used.
– Maniero
In the introduction of the article he talks about POO inheritance and not prototypes: "In OOP, inheritance refers to the ability of an object to access methods and other properties of another object."
– user98628
Did the answer resolve what was in doubt? Do you need something else to be improved? Do you think it is possible to accept it now?
– Maniero
I’m not talking about classes, you think I am because you think this is related to classes.
– Maniero
Because it made sense to talk about classes there, which is why it needs context.
– Maniero
Anyway, thank you for the reply. :)
– user98628
I think the subject is too comprehensive to be dealt with here, perhaps it would be interesting you seek a book on the subject, there are many good books out there.
– Zorkind
In a way yes. I’m already deepening in POO in books and courses.
– user98628