Can you explain me how a Controller can call another Controller method in a simple but still correct way?
Please provide some code!
background: I Have 2 different Controllers-View-Model and 2 libraries and they need to communicate between each other:
SettingsWindow/SettingsController/SettingsModel: Responsible for the app settings. The model is a singleton because I need the settings data all over the app;
A Library for Monitoring a directory which creates an event every time a file is created in a specific directory. The monitored dir path is defined in the SettingsModel; I'm using the Java 7 WatchService API for that;
A Library for Monitoring a webserver and download new files. The webserver address and the save directory are both defined in the SettingsModel; I'm using HttpsUrlConnection and a timer for that;
MainWindow/MainController/MainModel: Responsible for the main app window, which has a table that must be updated every time a new file is created in the monitored directory, and also everytime a file is downloaded by the above libraries.
So how do I correctly Instantiate and communicate those 4 different features?
How do their Controllers commnuicate between them, since they are all related?
How should I organize this project in terms of MVC?
PLEASE provide the basic MVC scaffold (skeleton) and show where I create the instances, where and how I call each others method. I'm new to Java, specially swing and mvc. I've read a lot, but I got stuck in this situation.