BT

Building a Reactive Process Manager Using Actor Model

| by Jan Stenberg Follow 34 Followers on Sep 05, 2014. Estimated reading time: 2 minutes |

Process managers are in general reactive since they often live in an Event Driven Architecture (EDA) Vaughn Vernon explains describing how to build a reactive process manager with a focus on the reactive part, using Actor model for the implementation.

Vaughn Vernon, author of Implementing Domain-Driven Design, describes a process manager as sitting in the centre managing different components involved in a process, the example used by Vaughn is the process of obtaining a quote for a home loan.

In his example Vaughn is creating a process manager supervising finding the best loan quotes from banks for an individual, the process manager beeing a Loan broker in the example. Other major components are a Process entity actor holding the state of the process, a Credit bureau actor which decides if the individual is qualified for a loan, and a number of Bank actors from which quotes are asked.

Current state is kept in the Process entity actor, outside of the Process manager; a basic principle in actor model is to look for every opportunity for concurrency, i.e. to create a new actor. It also allows the Process manager to focus just on the process, not on the current state and also adheres to the Single Responsibility Pattern (SRP).

Starting the process is a command message “Quote best loan rate”, followed by a "Process started event message and then a “Start loan rate quote” command message followed by a “Loan rate quote started” event message. The whole process ends with a “Loan rate best quote filled” message. Basically this is a request – reply pattern repeated several times.

Vaughn notes that the Loan broker has a lot of logic and compares it to commercial business process management tools with the main difference, besides cost, being that the Loan broker is specifically built for its purpose, not using any business level tools or language to describe the process.

To simplify making actor model diagrams, which he uses in his presentation, Vaughn has collaborated with Typesafe to create a set of standard actor model elements. The basic elements are for actors and messages, other elements depict creation and termination of actors and an actor’s lifeline.

Vaughn has written his example in C# using his recently published Dotsero, a toolkit that closely follows the Akka API, and which also includes the example code. The toolkit differs in approach to the one taken in Microsoft’s Orleans framework.

His example in Scala using Akka will be released together with the new book he is writing: Reactive Enterprise with Actor Model.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

reactive "low" intelligence? adaptive "high" intelligence? by William Louth

A video that inadvertently shows the difference between Reactive Programming (Type 1 Intelligence) and Self-Adaptive Software (Type 2 Intelligence).

Chris Adami, "the Path Towards Intelligent Machines" at the FQXi conference 2014 in Vieques
www.youtube.com/watch?v=E-kOMYmdlhg

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT