title: Should Calculation Progress logic reside on Service Layer?
body: <p>In my WPF applciation, my ViewModel, talks to a ViewModelService, which in turn talks to say for example a CalculationService to retrieve processed data to be presented in the View. I would like for the view to be able to report percentage of completion to the user. My question is two fold.</p>
  
  <p>The first is where should this logic reside? Should the       CalculationService be tasked with reporting progress along with the      actual results or does the ViewModel service calculate the progress      percentage details.</p>
  
  <p>Second, I see that I can achieve this using TPL or using ReactiveExtentions. Am leaning towards reactive extentions becuase in    my case, the calculation service's API and implementation looks like     this </p>
  
  <pre><code>//This is pseudo code, just aiming to show my intention here
      IEnumerable&lt;Output&gt; Calculate(IEnumerable&lt;Inputs&gt; inputs){
               List&lt;Output&gt; output = new List&lt;Output&gt;();
               foreach(var input : inputs){
                 //long running calculation, which produces output
                 //outputs.Add(output)
               }
             }
  </code></pre>
  
  <p>Am assuming that if I go down the Reactive route, I can use Reactive's OnNext to stream the "Output", as they arrive and I also can use Parallel.Foreach to gain performance.</p>
  
  <p>Any ideas or thoughts on this?</p>
  
  <p>Thanks
  Kay</p>