2 added 6 characters in body
source | link

The Messenger component has a dependency on the Controller component to be able notify the controller of incoming messages.

OMG java does not have events!!!

It does have several alternatives though. For example

https://docs.oracle.com/javase/6/docs/api/java/util/Observable.html

Here you would make your Messenger implement ObservableObservable and have the Controller call addObserveraddObserver The Messenger can then notify the Controller of incoming messages with its notifyObservers()notifyObservers() function without having to reference the Controller class.

There are several variations on the technique.

https://docs.oracle.com/javase/tutorial/uiswing/events/index.html

The Idea is that you pass in to the messenger the function to call when a message comes in rather than passing in the whole controller class.

The Messenger component has a dependency on the Controller component to be able notify the controller of incoming messages.

OMG java does not have events!!!

It does have several alternatives though. For example

https://docs.oracle.com/javase/6/docs/api/java/util/Observable.html

Here you would make your Messenger implement Observable and have the Controller call addObserver The Messenger can then notify the Controller of incoming messages with its notifyObservers() function without having to reference the Controller class.

There are several variations on the technique.

https://docs.oracle.com/javase/tutorial/uiswing/events/index.html

The Idea is that you pass in to the messenger the function to call when a message comes in rather than passing in the whole controller class.

The Messenger component has a dependency on the Controller component to be able notify the controller of incoming messages.

OMG java does not have events!!!

It does have several alternatives though. For example

https://docs.oracle.com/javase/6/docs/api/java/util/Observable.html

Here you would make your Messenger implement Observable and have the Controller call addObserver The Messenger can then notify the Controller of incoming messages with its notifyObservers() function without having to reference the Controller class.

There are several variations on the technique.

https://docs.oracle.com/javase/tutorial/uiswing/events/index.html

The Idea is that you pass in to the messenger the function to call when a message comes in rather than passing in the whole controller class.

1
source | link

The Messenger component has a dependency on the Controller component to be able notify the controller of incoming messages.

OMG java does not have events!!!

It does have several alternatives though. For example

https://docs.oracle.com/javase/6/docs/api/java/util/Observable.html

Here you would make your Messenger implement Observable and have the Controller call addObserver The Messenger can then notify the Controller of incoming messages with its notifyObservers() function without having to reference the Controller class.

There are several variations on the technique.

https://docs.oracle.com/javase/tutorial/uiswing/events/index.html

The Idea is that you pass in to the messenger the function to call when a message comes in rather than passing in the whole controller class.