I find myself having to implement multiple change listeners in a single class, and I was wondering if there was a way to do this that wouldn't trigger compilation problems. For example, let's say you have a LineChart, and you want the chart to listen for changes to the data, but also changes to the user's smoothing algorithm selection. You might try declaring your class like this:
public class MyGraph implements DataChangeListener, SmoothingChangeListener {....
where you've declared DataChangeListener, and SmoothingChangeListener as
DataChangeListener extends ChangeListener<SomeDataStructure>{...}
SmoothingChangeListener extends ChangeListener<ISmoothable>{...}
The compiler will tell you immediately that MyGraph can only implement one ChangeListener.
In real life, I have classes that have to listen for multiple types of events, and both for the sake of semantic clarity and for the sake of feasibility, they need to implement those change listeners. I've used event buses in certain cases, but they tend to obscure what the class is actually listening to.
Is there a better way of doing this?