RIDDL Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Messages

Messages are a foundational concept in RIDDL because a RIDDL model implies an implementation that is a message-driven system per the Reactive Manifesto. Messages in RIDDL are a special case of an aggregate type and the lingua franca of many RIDDL definitions. They define the API for all the processors:

Differences Between Kinds of Messages

RIDDL follows Bertrand Meyer’s notion of command/query separation which states, in the context of object-oriented programming in Eiffel that:

every method should either be a command that performs an action, or a query that returns data to the caller, but not both. In other words, asking a question should not change the answer.1

Consequently, RIDDL adheres to this principal and employs the notion in message definitions since RIDDL is message-oriented not object-oriented. However, RIDDL also includes message types for the responses from commands and queries, events and results, respectively. The following subsections provide definitions of these four things

Command

A directive to perform an action, likely resulting in a change to some information.

Event

A recordable fact resulting from a change to some information.

Query

A request for information from something

Result

A response to a query containing the information sought.

Summary

The various characteristics of the four kinds of messages are shown in the table below.

KindRequest?Response?Cancellable?Relationship
CommandYesNoYesIndependent
EventMaybeYesNoConsequent Of Command
QueryYesNoYesIndependent
ResultNoYesNoConsequent Of Query

The truth table above helps you understand the relationship between the kind of message and how it is handled by a model component. The sections below get even more specific.

How Messages Are Handled By Adaptors

KindIn Regard To Handling By Adaptor
CommandIntent To Translate For Context
EventIntent To Translate For Context
QueryIntent to Translate For Context
ResultIntent to Translate For Context

How Messages Are Handled By Applications

KindIn Regard To Handling By Application
CommandData given from user to application
EventNot Applicable
QueryNot Applicable
ResultData provided to user from application

How Messages Are Handled By Contexts

KindIn Regard To Handling By Context
CommandIntent To Take Some Stateless Action
EventNotification That a Command Completed
QueryIntent to Read From The Context
ResultResult Of Reading From Context

How Messages Are Handled By Entities

KindIn Regard To Handling By Entity
CommandIntent To Modify Entity State
EventEntity State Was Changed
QueryIntent To Read Entity state
ResultConsequent Of Query

How Messages Are Handled By Processors

KindIn Regard To Handling By Processor
CommandIntent To Update Projection State
EventThe Projection’s State Was Modified
QueryIntent to Read Projection State
ResultResult Of Reading Projection State

How Messages Are Handled By Projections

KindIn Regard To Handling By Projection
CommandIntent To Update Projection State
EventThe Projection’s State Was Modified
QueryIntent to Read Projection State
ResultResult Of Reading Projection State

Occurs In

All Vital Definitions

Contains

Fields


  1. Meyer, Bertrand. “Eiffel: a language for software engineering”. p. 22 ↩︎