Responsibility for spawning threads in MVC / similar patterns.
Hopefully a quick one this time.
You have a GUI application based on MVC that does various things using the model. Some of these things can just be done on the event thread but others should get their own threads. What is responsible for making that decision - the view, the controller, or the model?
Drake
[325 byte] By [
Drake_Duna] at [2007-10-2 11:12:08]

Nobody else wants to answer this? Okay... I think it's the responsibility of the programmer.
Normally you'd decide in advance which tasks would run in-line and which would be farmed out to run in a separate thread, because you have a pretty good idea of how long things take. You could be wrong, but being wrong happens and that's why we have refactoring.
But if there was some programming logic that somehow looked at a task and intuited whether it was going to be long-running or not, and decided on that basis whether to run it in a separate thread? Sounds like controller logic to me. The controller is in charge of making things happen, the model is in charge of keeping the data straight, and the view is in charge of showing the data to people.