I have 2 kinds of C# WPF app projects:
I consider these patterns (APM, EAP, and BGW in particular) obsolete in .NET 4.5. The combination of async
with Task.Run
is superior to BGW in every way. In fact, I just started a series on my blog where I will compare BGW to Task.Run
and show how it's more cumbersome in every situation; there are some situations where it's just slightly more cumbersome, but there are other situations where it's much more cumbersome.
Now, whether they're obsolete in .NET 4.0 is another question entirely. From your other posts, you're talking about developing for .NET 4.0 with VS2010, so the backport Microsoft.Bcl.Async
isn't an option. In that case, neither APM nor EAP can be considered obsolete IMO. On this platform, you can consider Task.Factory.StartNew
as an alternative to BGW but BGW does have some advantages when it comes to progress reporting and automatic thread marshaling of its progress and completion events.
Update: I did recently update an old blog post of mine where I discuss various implementations of background operations. In that post, when I talk about "Tasks (Async Methods)", I mean using Task
with all the .NET 4.5 async
support, Task.Run
, etc. The "Tasks (Task Parallel Library)" section is evaluating Task
as it existed in .NET 4.0.