Account Machine 3
can be viewed as an abstrac-
tion of all non-negative values of the local storage
attribute
Balance
in
Account Machine 1
.
The use of these abstraction mechanisms has no
affect on the semantics of machine composition, and
is therefore orthogonal to the ability to perform local
reasoning about behavior.
6.5 Behavioral Types
So far we have taken the protocol rules specified in
a Protocol Model to be non-discretionary statements
about when an event can take place. If an event is
refused, no update or change of state takes place. In
effect, the event is rejected as an error. Other classes
of behavioral rules are weaker than this, and should
not prevent an event but only provide guidance on
whether it should happen or not. An example is at-
tempting to access a website in Microsoft Internet Ex-
plorer v.7 (IE) when the security certificate held by
site is not recognized or is invalid. IE alerts the user,
with an alert and by coloring the header bar red, but
does not prevent access to the site.
In the model shown in Figure 3, it may be that the
Bank’s policy is not to prevent its Customers from go-
ing over their account overdraft limit but merely warn
them if a withdraw does so. A violation of the rule in
Account Machine 4
should not then cause a
Withdraw
event to be rejected, but instead should cause an alert
to the Customer that the event breaches the account
limit. To model this, we give a different Behavioral
Type to
Account Machine 4
to reflect this weaker pro-
tocol effect. A range of such weaker Behavioral Types
is possible, two being:
Allowed: Refused events are flagged as not desired
or in violation of policy (but are not prevented).
Desired: Accepted events are flagged as desired or
required (i.e., similar to a workflow rule).
Combining machines with different Behavioral Types
so as to prevent, encourage and discourage differ-
ent events under different circumstances is a way of
building behavioral intelligence into the model, so
that the system is active in policing the rules and poli-
cies required in the domain. Complete discussion of
this topic is beyond the scope of this paper, and more
information can be found in (McNeile and Simons,
2007).
Building behavioral intelligence into objects in
this way means that business processes become emer-
gent properties of the combined behavior of the par-
ticipating objects, rather than being defined as process
flow models using languages such as BPEL. This idea
(which has hinted at by others, for instance Fielding
with his idea of Hypermedia as the engine of applica-
tion state (Fielding, 2000)) involves less redundancy
of rule definition than the process flow modeling ap-
proach, which normally requires that behavioral rules
about an object be repeated in each process that in-
volves the object. Making an object the owner of its
own behavioral rules ensures that any change is auto-
matically propagated to all business process contexts
in which that object participates. This makes pro-
cesses easier to modify and hence enhances business
agility.
7 PRACTICAL OBSERVATIONS
The aim of a language such as the one described
here must be to close the gap between the way soft-
ware is described in the analysis and design stages of
a project, and the way it is described in executable
form. The more this gap can be closed, the better the
software development process can be engineered to
avoid the familiar problems associated with human in-
terpretation and translation of one description into an-
other. Ideally, in our view, the software development
should involve executable artifacts from the begin-
ning, and the process should be based around incre-
mental review, testing and refinement (and, perhaps,
automated transformation) of such artifacts. The early
focus of the process is on the behavioral requirements,
the later focus on the implementation environment
(target platform) and such issues as performance.
The language described here has proved valuable
in the early stages of development, where the focus is
on behavioral requirements. The richness of the be-
havioral semantics of the language makes it possible
to provide a generic user interface which interprets the
model to:
• Display, for a selected object, what events the ob-
ject understands.
• Color code events to indicate whether they are not
possible (”Greying out”), possible but discour-
aged, or possible and encouraged.
• Create ”pick-lists” of suitable target objects for an
event, being those objects that understand and can
accept it.
• Create suitable user-oriented error or warning
messages when a protocol rule has been violated.
An illustrative example of such a generic user inter-
face is shown in Figure 4. The important point is that
a generic user interface requires no more information
than is present in the model (for instance Figure 3)
and the associated instance data, so it is not neces-
sary to model or program it. This means that when
PROGRAMMING IN PROTOCOLS - A Paradigm of Behavioral Programming
29