Skip to main content
added 3 characters in body
Source Link

I think it's better to distinguish between two cases here:

  • For a template method I believe it's better to have empty virtual method in base class. If you don't need to add any functionality you just ignore this part, but you will add some code only if you need to. This is exactly your case.

  • For a public method I believe it's better to have abstract method in base class. It's very unusual situation that your public method does no-op and at the same time you will not forget to implement it.

I think it's better to distinguish between two cases here:

  • For a template method I believe it's better to have empty virtual method in base class. If you don't need to add any functionality you just ignore this part, but you will add some code only if you need to. This is exactly your case.

  • For a public method I believe it's better to have abstract method in base class. It's very unusual situation that your public method does no-op and the same time you will not forget to implement it.

I think it's better to distinguish between two cases here:

  • For a template method I believe it's better to have empty virtual method in base class. If you don't need to add any functionality you just ignore this part, but you will add some code only if you need to. This is exactly your case.

  • For a public method I believe it's better to have abstract method in base class. It's very unusual situation that your public method does no-op and at the same time you will not forget to implement it.

Source Link

I think it's better to distinguish between two cases here:

  • For a template method I believe it's better to have empty virtual method in base class. If you don't need to add any functionality you just ignore this part, but you will add some code only if you need to. This is exactly your case.

  • For a public method I believe it's better to have abstract method in base class. It's very unusual situation that your public method does no-op and the same time you will not forget to implement it.