The Dependency Inversion Principle (DIP) is a principle of object-oriented design that will change the way you think about writing software. It is one of the 5 SOLID principles Robert Martin discusses in his book, I highly recommend checking this book out if you have never read it. I gave a presentation on the DIP with Stephen Loftus-Mercer at NI Week 2015, and just gave a slightly different presentation on the DIP at the Software Craftsmanship Workshop at NI Days Boston 2015. Below is a recording of the Software Craftsmanship Workshop presentation, along with my slides.
Depend upon abstract entities, not concrete entities
Communication between Actors is meant to be done by traversing the Actor tree. Assuming we decide not to pass message enqueuers around to all Actors in the tree, we will end up with a lot of message classes and a lot of message routing. The extra messages and routing, however, buys us robustness as Actor E has no way of knowing if Actor C currently exists. But what if we could bypass the tree for certain types of messages in a way that allowed us to decouple our actors from each other...