I have a design problem in Java. I have
- an abstract class
Featurewhich represents features (machine learning), and - an abstract class
Normalizablewhich inherits fromFeatureand represents features which can be normalized.
A concrete feature can be an instance of either Feature or Normalizable.
I would like to introduce an abstract class called Probablity which inherits from Feature and represents features on which some sort of probability calculations can be done.
An actual feature should either be an instance of Feature (not normalizable and no probability) or it should be an instance of Normalizable, or Probability or both.
The problem now is that an actual feature cannot inherit from both Normalizable and Probability.
How can I solve this issue? I think using interfaces is not the solution because all of the mentioned classes contains implementations.
FeatureaProbability. It's better to call it sayProbabilisticFeature. To further help you, can you identify some methods with appropriate names on each of these classes?