LabVIEW Craft
  • Blog
  • About
  • Contact
  • Tools
  • Resources

Decoupling actors with Event-Driven Architectures

12/14/2016

1 Comment

 
Jon McBee
In my last post I took a look at data-centric and message-centric communication and their effects on software systems.  This post will take that discussion a little bit further by connecting the idea of data-centric messaging to Event Driven Architecture (EDA).  Along the way, we will build up a vocabulary that we can use to disucss systems of actors and the types of coupling we encounter while building them.
Picture
In the post on Data-Centric vs Message-Centric Communication, we considered how message-centric communication couples the information being sent between two actors with how the receiving actor handles the information.  Specifically, we took a look at the Actor Framework and how its use of the command pattern implied that each message class would call one of the recieving Actor's methods.  We then compared the Actor Framework to a data-centric implementaiton of inter-actor communication.  We finished by describing how message-centric communication typically sends verbs, while data-centric communication typically updates nouns.  That data-centric communication  example was an example of EDA where the updating of nouns is analogous to the publishing of events.  
Picture
In an effort to build up a common vocabulary, I will refer to actor systems that rely on command and query messages rather than events as Imperative Actors.  Actor Framework Actors are Imperative Actors by definition because their message execution is based on the command pattern.
Picture
We can call actors that use data-centric communication mechanisms Reactive Actors because they react to events being raised by other actors in the system.  The basic system model for for this type of interaction between actors relies on an event notification service providing storage and management for subscriptions and efficient delivery of events.  In previous discussions, we have seen how an implementation of the mediator design pattern solves this problem.
We can build a system of Reactive Actors using an EDA where the publishers of events do not hold references to the subscribers, nor do they know how many subscribers are participating in the interaction.  Similarly, the subscribers do not hold references to the publishers, nor do they know how many of publishers are participating in the interaction.  This inversion of communication dependencies leads to very loosely Reactive Actors.
Picture
The event-based interaction paradigm is based on decoupling producers and consumers of events.  The main advantage of decoupling the production and consumption of events is an
increased scalability in our application as a whole. The three common dimensions of coupling between event producers and consumers are space, time and synchronization.
Picture
We can say that two actors are spatially decoupled if they do not need to know about each other in order to communicate.  If one actor needs to have a reference to another actor for communication then it can be said that they are spatially coupled.  We can accomplish this in an EDA through the use of a mediator that allows publishers to publish events to relevant topics and subscribers to receive notification of events from the topics that they subscribe to.
Picture
We can say that two actors are temporally decoupled if they do not need to be actively involved in interactions at the same time.  In particular, the publisher might publish some events while the subscriber is disconnected, and conversely, the subscriber might get notified about the occurrence of some event while the original publisher of the event is disconnected.
Picture
We can say that two actors are synchronously decoupled if publishing actors are not blocked while producing events, and subscribing actors can get asynchronously notified of the occurrence of an event while performing some concurrent activity. The production and consumption of events do not happen in the main flow of control of the publishers and subscribers, and do not therefore happen in a synchronous manner.
Picture
That the leaves the last type of decoupling, semantic decoupling.  Event semantic decoupling refers to the requirement that event producing and consuming actors can exchange events without a priori full understanding of, or agreement on the vocabulary used to describe event types, properties, or values.  ​If an event system assumes mutual agreement on event types, properties, and values, this agreement is an explicit dependency between parties. 
Picture
My current event semantics use a message interface class as an event abstraction.  Any subclass of the message interface class can be sent by publishing actors and received by subscribing actors.  The problem is that this implementation does not decouple the event semantics; it requires that the publisher and the subscriber agree on the type of the message object.  This means that the subscriber actor must always attempt to typecast the message object to the type it expects to receive.
There are a few interesting ideas that can be used to help alleviate this semantic coupling, but we would need to talk through implementation detail of the mediator and topic actors first for context.  For this reason, I will leave the expansion of this idea for my next post.

Jon McBee is the Founder and Managing Partner at Composed Systems and is a Certified LabVIEW Architect, Certified LabVIEW Embedded Developer, Certified TestStand Developer, an NI Certified Professional Instructor, a LabVIEW Champion, and a Certified ScrumMaster
References:
  • Reactive Cloud Actors
  • The Many Faces of Publish/Subscribe
  • Approximate Semantic Matching of Heterogeneous Events
1 Comment
Irby Pace link
3/21/2026 07:21:32 pm

I find the concept of decoupling producers and consumers of events very appealing for its scalability benefits.

Reply



Leave a Reply.

    RSS Feed

    Tags

    All
    Abstract Messaging
    Actor Framework
    Agile
    AI
    Asynchronous Programming
    Best Practices
    C#
    Complexity
    Continuations
    Control Values By Index
    Craftsmanship
    Dependency Inversion
    Dependency Viewer
    Futures/Promises
    Genetic Algorithm
    Liskov Substitution
    Malleable VIs
    Mediator Pattern
    .NET
    Object Oriented
    Object-Oriented
    Packed Project Library
    Parallelism
    Polymorphism
    Pub/Sub
    RawCap
    Root Loop
    Scrum
    Task Parallel Library
    TCP/IP
    TDD
    Test Engineering
    UML
    Unit Test
    VI Scripting
    VI Server
    WireShark

    Archives

    October 2019
    April 2019
    July 2018
    October 2017
    March 2017
    February 2017
    January 2017
    December 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    August 2015
    February 2015
    January 2015

    LabVIEW Blogs

    Eyes on VIs
    LabVIEW Hacker
    VI Shots
    LabVIEW Artisan
    Software Engineering for LabVIEW
    ​Wiresmith Techology
Picture
Powered by the Panda Ant

  • Blog
  • About
  • Contact
  • Tools
  • Resources