on both the +ve and -ve sides, setting
up the situation for a spark. Next the
interaction happens on print opening up rtnPrint on the Tell side
(+ve). This leads to interaction with
rtnPrint, leading to the next set of
interactions. The interactions’ trace is
shown in Figure 8.
These actions are represented as
REST URIs (uniform resource identifiers), so they can be interacted
with over the network. Network
programming is as simple as bringing agents into configurations
with the objective of precipitating
A Simple CRUD Application
MasterKube software technology5 is
built with this network application
in mind. The MasterKube software
paradigm is used to build a simple
Define action. The first step is
to define all actions that will be exposed to the outside system. These
can be observed by any client UI that
understands the MasterKube XML response. In this case there are actions
to Add, Edit, View, and Delete, as
illustrated in Figure 9.
Define behavior. Agents provide
the dynamic part of the application.
The agent AddContactAgent in the
following code shows the action Add,
which, when interacted with, creates
a new agent. The AddContactAgent shows the Add UI. On interacting with the Add action, it creates the
Contact, and AddContactAgent is
repeated to show the same action (see
When there is interactions with
Edit, it shows with all the elements
that are in the Edit action. These are
expected to be entered. On accepting
these values into the system, EditContactAgent is repeated. Repeating the
same agent gives the choice of the Edit,
Delete, and View actions again, thereby exhibiting a persistent behavior.
In the Delete action the Choice
action is empty. As there are no observations, interaction with Delete leaves
no further observations and, hence, the
contact is considered deleted.
All these actions are exposed as
REST URLs, which can be interpreted
by any device.
Hello, World Application
Network applications are best addressed
when based on communication. Unlike the functional model of computation (which has functions to move data
from one variable to another) in a network application the movement of
data is done by communication. As in
physics, the flow of current is defined
by the potential. Similarly, network applications are defined by setting up
communication potential and are then
wired together to create the spark that
ensures the flow of information from
the source to the sink.
The first step in building a network
application is to define what flows
when this spark happens. To de-
fine this action then defines which
elements flow through it. Once the
action is defined, then the two po-
tentials for this action are set up by
creating the +ve and -ve. The +ve
is the source of information (like x–,
in π-calculus), and the -ve (like x in
π-calculus ) is the sink of information.
Tell sets up the +ve source of infor-
mation, and Ask sets up the -ve sink
The Hello, World network application has two agents that operate concurrently to deliver the functionality.
MainAgent is composed of two sequences of two actions each. When this
agent is activated, it activates main and
MainAgent = Compose [
Sequence [ Ask(main);
Tell(print)]; Sequence [
The second agent is PrintAgent:
PrintAgent = Sequence [
Ask(print); Tell(rtnPrint) ]
Compose [ MainAgent;
Figure 8 shows the different actions
that are on when each action is interacted with. To begin with, all agents
become active and the actions main,
rtnPrint, and print are exposed
on the Ask side (-ve). The main
action would be exposed, so it can be
interacted with from a user interface.
When main is interacted with, it activates print on the Tell side (+ve).
The same name, print, is now active
Figure 8. Interactions trace.
Current Interaction - Reaction
between +ve and -ve
initial configuration initial configuration main, rtnPrint, print —
on interacting with main rtnPrint, print print
on interacting with print rtnPrint rtnPrint
on interacting with rtnPrint — rtnMain
Figure 9. Action definition.