java - Multiple Observers observing multiple observables - How to update without instanceof? -


say each of these observers observing different observables. operations observing different too.observers inherit interface update(observable method). observables subclasses inherit class observable(my own, not java implementation). none of observables have similar methods either. over-engineering observer pattern? heres example:

  • observers , b
  • observables 1,2, , 3.
  • observer observing observable 1 , 2.
  • observer b observing observable 3.

  • observable 1 notifies when been instantiated.

  • observable 2 notifies when isworking has been set true via setter
  • observable 3 notifies b when either of setters have been called.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -