How to organize an indication of the status of the task, with minimal interaction with the user interface? For example, the program performs a long calculation (possibly in a separate thread), and the user displays the progress bar in the GUI
. I thought to create some intermediate object that will be passed to the task. And this, let's call it ProgressMonitor
will send a message to the interface that the process is in ProgressMonitor
. In general, the task being performed should not be aware of the GUI
. It is desirable that the GUI
know less about the task, ideally you only need to execute the StartTask
function, and all the work will be performed by the task.
Can anyone know a different solution? Is there a design pattern for this case? Just in case I will add that I write on Java
. I use JavaFX
as a library for GUI
.