EDIT:
To be clear: The fact that the design is quite ugly is not the point. The point is, that the design is there and I am in the situation to have to add another sub-c
You want children of MotorizedVehicle
to have a default implementation of bar
, but not so for the children of the FlyingMotorizedVehicle
.
abstract class BasicMotorizedVehicle
// no bar
... // Rest of old MotorizedVehicle
class MotorizedVehicle extends BasicMotorizedVehicle
Foo bar(...) { ... }
class FlyingMotorizedVehicle extends BasicMotorizedVehicle