Yes, you probably need separate registration and verification objects. The proposed template, with an abstract base and ValidationA and ValidationB, which extends it, will work. If you really don't have a “default check”, you can just do an interface check and have ValidatingA and ValidatingB that implement it, and then you can use polymorphism at runtime to invoke the correct check method.
One thing that I began to understand is that you can ask and ask, discuss and discuss all this that you want, but you will never know until you try. Pick up a quick abstract base class and two that extend it and see if it does what you want. If not, just refactoring. Of course, you have to consider technical debt, etc., but just give it a chance - this is the best way to find out.
source share