Re:Goodbye, shitty Car extends Vehicle object-orientation tu...
by kd5bjo on Sunday October 20, 2019 @12:14PM
(#21305034)
The “superclass” can take a config object with a well-defined interface in its constructor, and call methods on this config object when it might need to do something differently.
In Java, or C++, or Python, how can we allow superclass methods to call methods on a subclass (a form of late binding) without inheritance? I don't think it's possible. So unless I am much mistaken (and please correct me if I am wrong), inheritance is convenient for reducing boilerplate but necessary for late binding (in many languages).
Have I made a mistake in my analysis somewhere?