Hello jgomez,
Good to hear that you solved the problem. In fact, variants are not able to enhance the original class. Trying to do that would result in an ambiguous interface of the class. For example:
- Let's assume there is a class A.
- Let's assume there is variant V overriding class A.
- The variant V implements a method Foo()
- The variant V can be activated at the runtime depending on styles or at compilation time depending on profiles.
- Depending of whether the variant V is active or not, the method Foo() would be available or even not.
- This would result in the class A changing its interface dynamically.
Such dynamic behavior is not supported. The interface of a class has to be immutable. You can also compare it with classic inheritance. When you have a class A and class B descending from class A, methods added to class B are not visible in class A.
Your approach to solve the issue was correct. You ensured that the original class implements the complete interface, even if the methods are empty. Then in descending variants, you are free to implement the methods. If the variant is active, the implementation is used automatically. If the variant is not active, the default implementation found in the original class is used.
I hope the behavior is now better understandable ...
Best regards
Paul