This is a question about terminology in OOP.
Lets assume you have two classes A
and B
, with
class A extends B {}
Now B
has a method called doSomething()
, which it calls in its constructor
.
class B {
constructor() {
this.doSomething();
}
doSomething() {
/* some functionality almost all classes extending B need */
}
}
Now unfortunately A
neither wants nor needs what happens when B's constructor calls doSomething()
. It is even harmful to instances of A
.
Object orientation offers the option to overwrite (or is it override?) the method in the inheriting class:
class A extends B {
constructor() {
super(); // calls the contructor of B
}
doSomething() {
this.doNothing();
}
doNothing() {
return;
}
}
My question:
Is there a specific term in object orientation that describes exactly this way of overwriting/overriding an inherited method with a method that neutralizes the inherited methods functionality by basically doing nothing? How do you call A
's doSomething()
?