The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
You commented that it's wrong. Please explain why you feel that way.
It is a "GOTO" in disguise; your app send of a WM_MESSAGE and you're off hunting where that is consumed.
Sorry, but the messenger-idea is a solution is search of a problem; there's more efficient ways of inter-app communication, and they have been around for some time.
In the rare case where multiple machines need to communicate over the internet, I'd opt for my own sockets; even XMPP would be preferable to a "new" solution, as it limits my dependencies - there would be enough alternatives if the provider of the solution goes belly up.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
No, I get it. I've used it in a large scale app before. That's why I mentioned that I thought it could be hard to debug when to classes are firing messages back and forth. I'm just curious about how else this could be done in a simpler manner.
Disclaimer: Laurent is a friend of mine, so I might have some bias here.
Messenger/Mediator style communications are perfectly fine because they allow you to separate classes, sometimes over different assemblies, whereby you don't have to know where you're getting a message from, just that at some point, you might (or might not) receive a particular message. This is a perfectly valid way of decoupling classes. What you have to watch out for is something called message explosion, whereby you send everything that you can possibly think of over a messenger. If you're doing that, there should generally be other ways to do this.
BTW - if you're using MVVM Light, that's where the Messenger is.
I've used it before and I do like it. However I found that it leads to hard to debug code, especially if more than one process fires the same message concurrently. I've also seen apps that fire a message from class A to Class B, which then fires another message back to Class A. very hard to follow.
My mom, you tell her anything and very quickly everyone knows.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle