I need to pass an object from one class to many different classes.
The aim of this is to create one method that broadcasts the object to any other classes that are listening. This is so that more classes can be added and I just need to implement a listener function for that class and not edit any of the framework.
I am trying to accomplish this without the use of JMS (if it's possible!)
Observer pattern to the rescue! Woooosh!
Let your Subject define a method for relaying that object to many listening Observers. You can then dynamically add and remove listeners.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With