No, that's definitely not the way to implement it. A better way would be to define abstract `getOperator` and `getInverseOperator` methods on the base class, and override then in subclasses.