If you make your runProcess
method final
, then subclasses won't be able to override your method, and this can ensure that writeToLog
is called.
You can make writeToLog
private
to not expose the implementation.
You can make doYourProcessSpecificThing
protected
so that it can't be called directly, but subclasses can still define their own implementation.
This is called the Template Method Pattern. This allows the implementer (you) to define what specific behavior can be overridden, yet retaining control over the overall process/algorithm.