In some languages, the concept of a class and a superclass are explicit and the relationships between them are explicit. In other languages, superclasses can be declared but the relationship between subclass and superclass is implied. In some languages, even the abstraction itself is implied.
Yet the superclasses and relationships are always present, when relevant; even if only in our minds.
Let's start with the obvious case. Java, C#, C++, Swift and other, similar languages all encourage or even require declaring the abstractions and relationships. So, in these languages, the presence of super- and subclasses is easy to detect and visualize.
Two Subclasses and Their Superclass |
Two Subclasses Linked to Their Superclass Implicitly |
Yet classification of objects and creating ways of reusing alternatives is still necessary in order to write JavaScript code with any longevity or maintainability. You just have to do a little more of the work to detect what the super-classes are.
Two Subclasses with an Implicit Superclass |
Then there are languages like C, where the concept of a class, itself, is missing from the syntax. In this case you have to do all the work to visualize the entities, their relationships, and their categories of interchangeability.
An Implied Set of Classes that Share an Implied Superclass |
...but those things are still there.
The reason for this is because these structures exist in our minds. They are tools for how we think about problems, organize solutions, and connect pieces. The corresponding syntax elements are just ways to make it easier for us to write down that information.
Such features can make it easier for someone to learn or relearn what a design means. They can check for internal inconsistencies in how we express these ideas. In general, they make object-oriented design easier but they aren't what makes it possible for you.
Your mind does that.
Such features can make it easier for someone to learn or relearn what a design means. They can check for internal inconsistencies in how we express these ideas. In general, they make object-oriented design easier but they aren't what makes it possible for you.
Your mind does that.