Training Stream - Blueprint Communications with - February 23rd

They certainly do similar tasks, in that they have the same goal of enabling communication from one asset to another. The real difference is in the direction of the communication. Think of it like this:

  1. Blueprint Interfaces - Imagine handing a list of one-word commands to one of your friends. Simple stuff; words like “food,” “coffee,” “exercise” or whatever. You don’t really care how your friend does those things. You just want to be able to tap your friend on the shoulder at any given point and say one of those commands, and then have something happen in response. The key is that you’re actually having to go find your friend and tap him on the shoulder before anything can happen.

That’s like an interface. The list of commands is like the Blueprint Interface asset. Notice that it’s just a list. It doesn’t have step by step instructions (nothing like: pick up phone, call Domino’s, etc.). It’s just basic commands. Having to tap your friend on the shoulder is like getting the reference. And your friend can only do something on the list because you gave it to them and so they know about all the commands.

But say you go tap a perfect stranger, someone who doesn’t have the list. You walk up, tap them and say “pizza.” They might ignore you and walk away. That’s okay. You didn’t give them the list. Interfaces work the same way.

Better still, you could give the list to 2 different people! They might do different things in response. So you go tap Friend 1 and say coffee, and you get a caramel macchiato. Do the same thing to Friend 2 and they spend the rest of the day making a pot of cold brewed espresso. Two really different things! But that’s okay. Interfaces allow for that. They’re just simple commands and what happens on the far end can be different.

The KEY is you have to go Tap your friends on the shoulder and then issue a command. That’s just like how with Interfaces you must get that initial reference.

  1. Event Dispatchers - Dispatchers go the other way. Imagine you’re at a party with all of your friends. You’re all dancing to some amazing tune the DJ is playing. Every time he hits a drop, everyone brings it down hard and starts really dancing intensely. That’s kind of like an event dispatcher. You, the audience, are listening to the DJ. He’s just doing his thing. Each time he hits that amazing riff, you respond with your most amazing moves.

That’s a dispatcher. The sender (our esteemed DJ) is just up there jamming away. He knows what he’s doing and he’s selected a track that has a really awesome drop (that was him setting up his Dispatcher).

You are coming to the party and listening, and you’re reacting whenever he hits the drop. That’s just like Binding. You’re binding the event of bringing your A-game dance moves out when the bass hits.

But note that the DJ didn’t come tap you on the shoulder. You’re choosing to pay attention by attending the party. You, the listener, got the reference to him. He has no idea who you are.

You could stop listening and go home (Unbind). You could go unplug the DJ’s equipment (Unbind All) so no one else can listen anymore.

The KEY is that you, the receiver, needed a reference to the Sender, the DJ. The DJ doesn’t have to do anything special to you like tap you on the shoulder. He doesn’t even know you exist. You had to get a reference to HIM and attend his show. So the communication is going in the other direction, from Receiver to Sender, instead of from Sender to Receiver.

When to use each one of these really depends on what you’re doing and where you want to have to set up functionality. It’s about what you care about. It’s about who can get a reference to whom. Is it easier or does it make more sense for the Sender to get a reference to the Receivers? Use an Interface. Is it easier or does it make more sense for the Receivers to get a reference to the Sender? Use a Dispatcher.

You’re going to find this is often a philosophical question, meaning folks will handle it in different ways. Don’t stress that. There’s not always a “right” or “wrong” way in these things. There’s just the one that works best in your situation.

Does this help?