title: JavaFX Model View ViewModel where should I implement tasks?
body: <p>There are several tutorials and examples on this topic out there but they are all a sort of generic build only in one class to show how it works generally.</p>
  
  <p>So my question is when I would like to follow the MVVM pattern where I have to implement all my tasks?</p>
  
  <p>Given the following:</p>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>class Model {
  
     /* When I place the Task here how can I deal with arguments and results from ViewController? */
  
     public BufferedImage bigTask (String this, String and, Image that){
         // Some code to build a BufferedImage
     }
  }
  </code></pre>
  
  <p><strong>ViewModel:</strong></p>
  
  <pre><code>class ViewController {
  
       private BufferedImage myBufferedImage;
  
       @FXML
       private Button aButton;
  
  
  
       /*Should I implement my Task here? But how I get information about progress? */
  
       final Task&lt;Integer&gt; myTask = new Task&lt;Integer&gt;(){
  
            @Override
            protected Integer call() throws Exception{
  
                 updateProgress( // How to get here? Is it the right place? )
  
                 return null;
            }
  
       };
  
  
  
       @FXML
       void setOnAction(ActionEvent actionEvent){
  
            myBufferedImage = Model.bigTask("this", "that", new Image("path"));
  
       }
  }
  </code></pre>
  
  <p>Hope I could explain the problem. </p>
  
  <p>Thanks in advance!</p>