You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At current the ModelAdapter provide basic event support to allow all controllers to be notified when the models state is changed. Each controller can then ensure that values shown in it's view are consistent with the state of the model.
This solution allows controllers to be notified of other controllers actions on the model, while maintaining a loose coupling between controllers. This solution is satisfactory for current requirements, however it is limited since it does not allow communication between controllers unless a controller is performing an operation on the model.
Using Guava Event Bus would allow controllers to communicate without the ModelAdapter. The ModelAdapter could use the EventBus to fire Events related to the model, keeping that responsibility away from each controller. Controllers would be able to fire their own events for other events.
Need to consider the benefits and drawbacks, and what the probability is of any benefits being utilised/required in future updates.
The text was updated successfully, but these errors were encountered:
Adding EventBus support could help in implementing "next"/"previous" station buttons in the playback controller.
Ideally the "next" button will select the next channel to play based upon which station tab is open and which row is currently selected in that table whithin the StationBrowser. For this to work, the playback controller will need a way to communicate with the StationBrowser controller.
…ationManager. The Station interface now contains only getters. A MutableStation interface has been added which extends the Station interface, providing access to setters. The RadioStation class now implements MutableStation, however any time the StationManager publishes a station it is cast to immutable type Station. MutableStation is package private to prevent clients altering Station state. Station instances are not entirerly immutable since the StationManeger can still modify it's contents, however to the rest of the application these instances are effectively immutable since they are unmodifiable through the Station interface. By making station instances immutable, and by containing instances in an unmodifiableList when publishing, the StationManager ensures external actors cannot alter the StationManagers state illegaly (by either modifying the list or any Station instances contained in the list).
At current the ModelAdapter provide basic event support to allow all controllers to be notified when the models state is changed. Each controller can then ensure that values shown in it's view are consistent with the state of the model.
This solution allows controllers to be notified of other controllers actions on the model, while maintaining a loose coupling between controllers. This solution is satisfactory for current requirements, however it is limited since it does not allow communication between controllers unless a controller is performing an operation on the model.
Using Guava Event Bus would allow controllers to communicate without the ModelAdapter. The ModelAdapter could use the EventBus to fire Events related to the model, keeping that responsibility away from each controller. Controllers would be able to fire their own events for other events.
Need to consider the benefits and drawbacks, and what the probability is of any benefits being utilised/required in future updates.
The text was updated successfully, but these errors were encountered: