There is even a design pattern related to this: Template Method.