Is there a pattern whereby a subclass guarantees it will call certain methods?

Viewed 136

Is there a pattern, or structure that guarantees that a subclass will, at a certain stage in it's life cycle will either call certain methods?

I'm looking for something similar to when a class implements a certain interface, it is essentially saying that it promises to implement certain methods.

Anti Pattern? I understand that this may be in-fact some sort of antipattern. I basically need to a sanity check that a collection of subclasses are doing the work they should be doing. If nothing exists, I'll simply write a mini file parser that will do a quick check that the methods are called.

This question is language agnostic, but in this case I'm using C#

5 Answers
Related