<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
flow-based	B-Application
programming	I-Application
(	O
FBP	O
)	O
is	O
a	O
programming	O
paradigm	O
that	O
defines	O
applications	B-Application
as	O
networks	O
of	O
"	O
black	B-Device
box	I-Device
"	O
processes	B-Operating_System
,	O
which	O
exchange	O
data	O
across	O
predefined	O
connections	O
by	O
message	B-Architecture
passing	I-Architecture
,	O
where	O
the	O
connections	O
are	O
specified	O
externally	O
to	O
the	O
processes	B-Operating_System
.	O
</s>
<s>
These	O
black	B-Device
box	I-Device
processes	B-Operating_System
can	O
be	O
reconnected	O
endlessly	O
to	O
form	O
different	O
applications	B-Application
without	O
having	O
to	O
be	O
changed	O
internally	O
.	O
</s>
<s>
FBP	O
is	O
thus	O
naturally	O
component-oriented	B-Architecture
.	O
</s>
<s>
FBP	O
is	O
a	O
particular	O
form	O
of	O
dataflow	B-Application
programming	I-Application
based	O
on	O
bounded	O
buffers	O
,	O
information	O
packets	O
with	O
defined	O
lifetimes	O
,	O
named	O
ports	O
,	O
and	O
separate	O
definition	O
of	O
connections	O
.	O
</s>
<s>
Flow-based	B-Application
programming	I-Application
defines	O
applications	B-Application
using	O
the	O
metaphor	O
of	O
a	O
"	O
data	O
factory	O
"	O
.	O
</s>
<s>
It	O
views	O
an	O
application	O
not	O
as	O
a	O
single	O
,	O
sequential	O
process	O
,	O
which	O
starts	O
at	O
a	O
point	O
in	O
time	O
,	O
and	O
then	O
does	O
one	O
thing	O
at	O
a	O
time	O
until	O
it	O
is	O
finished	O
,	O
but	O
as	O
a	O
network	O
of	O
asynchronous	O
processes	B-Operating_System
communicating	O
by	O
means	O
of	O
streams	B-Architecture
of	O
structured	O
data	O
chunks	O
,	O
called	O
"	O
information	O
packets	O
"	O
(	O
IPs	O
)	O
.	O
</s>
<s>
The	O
network	O
is	O
defined	O
externally	O
to	O
the	O
processes	B-Operating_System
,	O
as	O
a	O
list	O
of	O
connections	O
which	O
is	O
interpreted	O
by	O
a	O
piece	O
of	O
software	O
,	O
usually	O
called	O
the	O
"	O
scheduler	O
"	O
.	O
</s>
<s>
The	O
processes	B-Operating_System
communicate	O
by	O
means	O
of	O
fixed-capacity	O
connections	O
.	O
</s>
<s>
A	O
connection	O
is	O
attached	O
to	O
a	O
process	O
by	O
means	O
of	O
a	O
port	B-Protocol
,	O
which	O
has	O
a	O
name	O
agreed	O
upon	O
between	O
the	O
process	O
code	O
and	O
the	O
network	O
definition	O
.	O
</s>
<s>
At	O
any	O
point	O
in	O
time	O
,	O
a	O
given	O
IP	O
can	O
only	O
be	O
"	O
owned	O
"	O
by	O
a	O
single	O
process	O
,	O
or	O
be	O
in	O
transit	O
between	O
two	O
processes	B-Operating_System
.	O
</s>
<s>
for	O
the	O
input	O
port	B-Protocol
of	O
the	O
Collate	O
component	O
described	O
below	O
.	O
</s>
<s>
It	O
is	O
the	O
combination	O
of	O
ports	O
with	O
asynchronous	O
processes	B-Operating_System
that	O
allows	O
many	O
long-running	O
primitive	O
functions	O
of	O
data	O
processing	O
,	O
such	O
as	O
Sort	O
,	O
Merge	O
,	O
Summarize	O
,	O
etc.	O
,	O
to	O
be	O
supported	O
in	O
the	O
form	O
of	O
software	O
black	B-Device
boxes	I-Device
.	O
</s>
<s>
Because	O
FBP	O
processes	B-Operating_System
can	O
continue	O
executing	O
as	O
long	O
they	O
have	O
data	O
to	O
work	O
on	O
and	O
somewhere	O
to	O
put	O
their	O
output	O
,	O
FBP	O
applications	B-Application
generally	O
run	O
in	O
less	O
elapsed	O
time	O
than	O
conventional	O
programs	O
,	O
and	O
make	O
optimal	O
use	O
of	O
all	O
the	O
processors	O
on	O
a	O
machine	O
,	O
with	O
no	O
special	O
programming	O
required	O
to	O
achieve	O
this	O
.	O
</s>
<s>
FBP	O
is	O
often	O
a	O
visual	B-Language
programming	I-Language
language	I-Language
at	O
this	O
level	O
.	O
</s>
<s>
Many	O
other	O
flow-based	O
languages/runtimes	O
are	O
built	O
around	O
more	O
traditional	O
programming	O
languages	O
,	O
the	O
most	O
notable	O
example	O
is	O
RaftLib	B-Language
which	O
uses	O
C++	O
iostream-like	O
operators	O
to	O
specify	O
the	O
flow	O
graph	O
.	O
</s>
<s>
FBP	O
has	O
much	O
in	O
common	O
with	O
the	O
Linda	B-Language
language	O
in	O
that	O
it	O
is	O
,	O
in	O
Gelernter	O
and	O
Carriero	O
's	O
terminology	O
,	O
a	O
"	O
coordination	O
language	O
"	O
:	O
it	O
is	O
essentially	O
language-independent	O
.	O
</s>
<s>
FBP	O
thus	O
lends	O
itself	O
to	O
the	O
concept	O
of	O
domain-specific	B-Language
languages	I-Language
or	O
"	O
mini-languages	B-Language
"	O
.	O
</s>
<s>
FBP	O
exhibits	O
"	O
data	O
coupling	B-Application
"	O
,	O
described	O
in	O
the	O
article	O
on	O
coupling	B-Application
as	O
the	O
loosest	O
type	O
of	O
coupling	B-Application
between	O
components	O
.	O
</s>
<s>
The	O
concept	O
of	O
loose	B-Application
coupling	I-Application
is	O
in	O
turn	O
related	O
to	O
that	O
of	O
service-oriented	O
architectures	O
,	O
and	O
FBP	O
fits	O
a	O
number	O
of	O
the	O
criteria	O
for	O
such	O
an	O
architecture	O
,	O
albeit	O
at	O
a	O
more	O
fine-grained	O
level	O
than	O
most	O
examples	O
of	O
this	O
architecture	O
.	O
</s>
<s>
An	O
example	O
of	O
this	O
is	O
the	O
distributed	B-Operating_System
data	I-Operating_System
flow	I-Operating_System
model	O
for	O
constructively	O
specifying	O
and	O
analyzing	O
the	O
semantics	O
of	O
distributed	O
multi-party	O
protocols	O
.	O
</s>
<s>
Flow-Based	B-Application
Programming	I-Application
was	O
invented	O
by	O
J	O
.	O
Paul	O
Morrison	O
in	O
the	O
early	O
1970s	O
,	O
and	O
initially	O
implemented	O
in	O
software	O
for	O
a	O
Canadian	O
bank	O
.	O
</s>
<s>
FBP	O
at	O
its	O
inception	O
was	O
strongly	O
influenced	O
by	O
some	O
IBM	O
simulation	O
languages	O
of	O
the	O
period	O
,	O
in	O
particular	O
GPSS	B-Language
,	O
but	O
its	O
roots	O
go	O
all	O
the	O
way	O
back	O
to	O
Conway	O
's	O
seminal	O
paper	O
on	O
what	O
he	O
called	O
coroutines	B-Architecture
.	O
</s>
<s>
A	O
second	O
implementation	O
was	O
done	O
as	O
a	O
joint	O
project	O
of	O
IBM	O
Canada	O
and	O
IBM	O
Japan	O
,	O
under	O
the	O
name	O
"	O
Data	B-Application
Flow	I-Application
Development	O
Manager	O
"	O
(	O
DFDM	O
)	O
,	O
and	O
was	O
briefly	O
marketed	O
in	O
Japan	O
in	O
the	O
late	O
'	O
80s	O
under	O
the	O
name	O
"	O
Data	B-Application
Flow	I-Application
Programming	I-Application
Manager	O
"	O
.	O
</s>
<s>
Generally	O
the	O
concepts	O
were	O
referred	O
to	O
within	O
IBM	O
as	O
"	O
Data	B-Application
Flow	I-Application
"	O
,	O
but	O
this	O
term	O
was	O
felt	O
to	O
be	O
too	O
general	O
,	O
and	O
eventually	O
the	O
name	O
"	O
Flow-Based	B-Application
Programming	I-Application
"	O
was	O
adopted	O
.	O
</s>
<s>
A	O
,	O
B	O
and	O
C	O
are	O
processes	B-Operating_System
executing	O
code	O
components	O
.	O
</s>
<s>
O1	O
,	O
O2	O
,	O
and	O
the	O
two	O
INs	O
are	O
ports	O
connecting	O
the	O
connections	O
M	O
and	O
N	O
to	O
their	O
respective	O
processes	B-Operating_System
.	O
</s>
<s>
It	O
is	O
permitted	O
for	O
processes	B-Operating_System
B	O
and	O
C	O
to	O
be	O
executing	O
the	O
same	O
code	O
,	O
so	O
each	O
process	O
must	O
have	O
its	O
own	O
set	O
of	O
working	O
storage	O
,	O
control	O
blocks	O
,	O
etc	O
.	O
</s>
<s>
Whether	O
or	O
not	O
they	O
do	O
share	O
code	O
,	O
B	O
and	O
C	O
are	O
free	O
to	O
use	O
the	O
same	O
port	B-Protocol
names	O
,	O
as	O
port	B-Protocol
names	O
only	O
have	O
meaning	O
within	O
the	O
components	O
referencing	O
them	O
(	O
and	O
at	O
the	O
network	O
level	O
,	O
of	O
course	O
)	O
.	O
</s>
<s>
In	O
combination	O
with	O
a	O
parametrization	O
ability	O
,	O
called	O
Initial	O
Information	O
Packets	O
(	O
IIPs	O
)	O
,	O
ports	O
provide	O
FBP	O
with	O
a	O
component	O
reuse	O
ability	O
,	O
making	O
FBP	O
a	O
component-based	B-Architecture
architecture	O
.	O
</s>
<s>
FBP	O
thus	O
exhibits	O
what	O
Raoul	O
de	O
Campo	O
and	O
Nate	O
Edwards	O
of	O
IBM	O
Research	O
have	O
termed	O
configurable	B-General_Concept
modularity	I-General_Concept
.	O
</s>
<s>
Information	O
Packets	O
or	O
IPs	O
are	O
allocated	O
in	O
what	O
might	O
be	O
called	O
"	O
IP	O
space	O
"	O
(	O
just	O
as	O
Linda	B-Language
's	O
tuples	O
are	O
allocated	O
in	O
"	O
tuple	O
space	O
"	O
)	O
,	O
and	O
have	O
a	O
well-defined	O
lifetime	O
until	O
they	O
are	O
disposed	O
of	O
and	O
their	O
space	O
is	O
reclaimed	O
-	O
in	O
FBP	O
this	O
must	O
be	O
an	O
explicit	O
action	O
on	O
the	O
part	O
of	O
an	O
owning	O
process	O
.	O
</s>
<s>
The	O
system	O
of	O
connections	O
and	O
processes	B-Operating_System
described	O
above	O
can	O
be	O
"	O
ramified	O
"	O
to	O
any	O
size	O
.	O
</s>
<s>
During	O
the	O
development	O
of	O
an	O
application	O
,	O
monitoring	O
processes	B-Operating_System
may	O
be	O
added	O
between	O
pairs	O
of	O
processes	B-Operating_System
,	O
processes	B-Operating_System
may	O
be	O
"	O
exploded	O
"	O
to	O
subnets	O
,	O
or	O
simulations	O
of	O
processes	B-Operating_System
may	O
be	O
replaced	O
by	O
the	O
real	O
process	O
logic	O
.	O
</s>
<s>
This	O
is	O
really	O
an	O
assembly	O
line	O
image	O
of	O
data	O
processing	O
:	O
the	O
IPs	O
travelling	O
through	O
a	O
network	O
of	O
processes	B-Operating_System
may	O
be	O
thought	O
of	O
as	O
widgets	O
travelling	O
from	O
station	O
to	O
station	O
in	O
an	O
assembly	O
line	O
.	O
</s>
<s>
IIPs	O
are	O
data	O
chunks	O
associated	O
with	O
a	O
port	B-Protocol
in	O
the	O
network	O
definition	O
which	O
become	O
"	O
normal	O
"	O
IPs	O
when	O
a	O
"	O
receive	O
"	O
is	O
issued	O
for	O
the	O
relevant	O
port	B-Protocol
.	O
</s>
<s>
Update	O
programs	O
are	O
generally	O
quite	O
hard	O
to	O
code	O
using	O
synchronous	O
,	O
procedural	O
code	O
,	O
as	O
two	O
(	O
sometimes	O
more	O
)	O
input	B-Architecture
streams	I-Architecture
have	O
to	O
be	O
kept	O
synchronized	O
,	O
even	O
though	O
there	O
may	O
be	O
masters	O
without	O
corresponding	O
details	O
,	O
or	O
vice	O
versa	O
.	O
</s>
<s>
In	O
FBP	O
,	O
a	O
reusable	O
component	O
(	O
Collate	O
)	O
,	O
based	O
on	O
the	O
unit	O
record	O
idea	O
of	O
a	O
Collator	O
,	O
makes	O
writing	O
this	O
type	O
of	O
application	O
much	O
easier	O
as	O
Collate	O
merges	O
the	O
two	O
streams	B-Architecture
and	O
inserts	O
bracket	O
IPs	O
to	O
indicate	O
grouping	O
levels	O
,	O
significantly	O
simplifying	O
the	O
downstream	O
logic	O
.	O
</s>
<s>
Collate	O
is	O
a	O
reusable	O
black	B-Device
box	I-Device
which	O
only	O
needs	O
to	O
know	O
where	O
the	O
control	O
fields	O
are	O
in	O
its	O
incoming	O
IPs	O
(	O
even	O
this	O
is	O
not	O
strictly	O
necessary	O
as	O
transformer	O
processes	B-Operating_System
can	O
be	O
inserted	O
upstream	O
to	O
place	O
the	O
control	O
fields	O
in	O
standard	O
locations	O
)	O
,	O
and	O
can	O
in	O
fact	O
be	O
generalized	O
to	O
any	O
number	O
of	O
input	B-Architecture
streams	I-Architecture
,	O
and	O
any	O
depth	O
of	O
bracket	O
nesting	O
.	O
</s>
<s>
Collate	O
uses	O
an	O
array-type	O
port	B-Protocol
for	O
input	O
,	O
allowing	O
a	O
variable	O
number	O
of	O
input	B-Architecture
streams	I-Architecture
.	O
</s>
<s>
Flow-based	B-Application
programming	I-Application
supports	O
process	O
multiplexing	O
in	O
a	O
very	O
natural	O
way	O
.	O
</s>
<s>
Since	O
components	O
are	O
read-only	O
,	O
any	O
number	O
of	O
instances	O
of	O
a	O
given	O
component	O
(	O
"	O
processes	B-Operating_System
"	O
)	O
can	O
run	O
asynchronously	O
with	O
each	O
other	O
.	O
</s>
<s>
When	O
computers	O
usually	O
had	O
a	O
single	O
processor	O
,	O
this	O
was	O
useful	O
when	O
a	O
lot	O
of	O
I/O	O
was	O
going	O
on	O
;	O
now	O
that	O
machines	O
usually	O
have	O
multiple	O
processors	O
,	O
this	O
is	O
starting	O
to	O
become	O
useful	O
when	O
processes	B-Operating_System
are	O
CPU-intensive	O
as	O
well	O
.	O
</s>
<s>
The	O
diagram	O
in	O
this	O
section	O
shows	O
a	O
single	O
"	O
Load	O
Balancer	O
"	O
process	O
distributing	O
data	O
between	O
three	O
processes	B-Operating_System
,	O
labeled	O
S1	O
,	O
S2	O
and	O
S3	O
,	O
respectively	O
,	O
which	O
are	O
instances	O
of	O
a	O
single	O
component	O
,	O
which	O
in	O
turn	O
feed	O
into	O
a	O
single	O
process	O
on	O
a	O
"	O
first-come	O
,	O
first	O
served	O
"	O
basis	O
.	O
</s>
<s>
using	O
CORBA	B-Architecture
,	O
MQSeries	B-Application
,	O
etc	O
.	O
</s>
<s>
hash	B-Algorithm
tables	I-Algorithm
or	O
caches	O
.	O
</s>
<s>
The	O
above	O
diagram	O
is	O
schematic	O
in	O
the	O
sense	O
that	O
the	O
final	O
application	O
may	O
contain	O
many	O
more	O
processes	B-Operating_System
:	O
processes	B-Operating_System
may	O
be	O
inserted	O
between	O
other	O
processes	B-Operating_System
to	O
manage	O
caches	O
,	O
display	O
connection	O
traffic	O
,	O
monitor	O
throughput	O
,	O
etc	O
.	O
</s>
<s>
This	O
sometimes	O
results	O
in	O
what	O
is	O
called	O
a	O
"	O
clash	O
"	O
,	O
requiring	O
the	O
program	O
to	O
be	O
split	O
into	O
multiple	O
programs	O
or	O
coroutines	B-Architecture
.	O
</s>
<s>
FBP	O
and	O
JSP	O
share	O
the	O
concept	O
of	O
treating	O
a	O
program	O
(	O
or	O
some	O
components	O
)	O
as	O
a	O
parser	B-Language
of	O
an	O
input	B-Architecture
stream	I-Architecture
.	O
</s>
<s>
The	O
model	O
is	O
then	O
transformed	O
into	O
a	O
set	O
of	O
sequential	O
processes	B-Operating_System
to	O
the	O
number	O
of	O
available	O
processors	O
.	O
</s>
<s>
If	O
we	O
label	O
streams	B-Architecture
,	O
as	O
shown	O
,	O
with	O
lower	O
case	O
letters	O
,	O
then	O
the	O
above	O
diagram	O
can	O
be	O
represented	O
succinctly	O
as	O
follows	O
:	O
</s>
<s>
Burge	O
showed	O
how	O
stream	O
expressions	O
can	O
be	O
developed	O
using	O
a	O
recursive	O
,	O
applicative	O
style	O
of	O
programming	O
,	O
but	O
this	O
work	O
was	O
in	O
terms	O
of	O
(	O
streams	B-Architecture
of	O
)	O
atomic	O
values	O
.	O
</s>
<s>
Furthermore	O
,	O
most	O
applicative	O
systems	O
assume	O
that	O
all	O
the	O
data	O
is	O
available	O
in	O
memory	O
at	O
the	O
same	O
time	O
,	O
whereas	O
FBP	O
applications	B-Application
need	O
to	O
be	O
able	O
to	O
process	O
long-running	O
streams	B-Architecture
of	O
data	O
while	O
still	O
using	O
finite	O
resources	O
.	O
</s>
<s>
Linda	B-Language
,	O
mentioned	O
above	O
,	O
is	O
one	O
such	O
.	O
</s>
<s>
The	O
difference	O
between	O
the	O
two	O
techniques	O
is	O
illustrated	O
by	O
the	O
Linda	B-Language
"	O
school	O
of	O
piranhas	O
"	O
load	O
balancing	O
technique	O
-	O
in	O
FBP	O
,	O
this	O
requires	O
an	O
extra	O
"	O
load	O
balancer	O
"	O
component	O
which	O
routes	O
requests	O
to	O
the	O
component	O
in	O
a	O
list	O
which	O
has	O
the	O
smallest	O
number	O
of	O
IPs	O
waiting	O
to	O
be	O
processed	O
.	O
</s>
<s>
Clearly	O
FBP	O
and	O
Linda	B-Language
are	O
closely	O
related	O
,	O
and	O
one	O
could	O
easily	O
be	O
used	O
to	O
simulate	O
the	O
other	O
.	O
</s>
<s>
An	O
object	O
in	O
OOP	B-Language
can	O
be	O
described	O
as	O
a	O
semi-autonomous	O
unit	O
comprising	O
both	O
information	O
and	O
behaviour	O
.	O
</s>
<s>
The	O
object	O
's	O
internal	O
data	O
can	O
only	O
be	O
accessed	O
by	O
means	O
of	O
method	O
calls	O
,	O
so	O
this	O
is	O
a	O
form	O
of	O
information	B-Application
hiding	I-Application
or	O
"	O
encapsulation	O
"	O
.	O
</s>
<s>
Encapsulation	O
,	O
however	O
,	O
predates	O
OOP	B-Language
-	O
David	O
Parnas	O
wrote	O
one	O
of	O
the	O
seminal	O
articles	O
on	O
it	O
in	O
the	O
early	O
70s	O
-	O
and	O
is	O
a	O
basic	O
concept	O
in	O
computing	O
.	O
</s>
<s>
Encapsulation	O
is	O
the	O
very	O
essence	O
of	O
an	O
FBP	O
component	O
,	O
which	O
may	O
be	O
thought	O
of	O
as	O
a	O
black	B-Device
box	I-Device
,	O
performing	O
some	O
conversion	O
of	O
its	O
input	O
data	O
into	O
its	O
output	O
data	O
.	O
</s>
<s>
This	O
constitutes	O
a	O
form	O
of	O
design	B-Application
by	I-Application
contract	I-Application
.	O
</s>
<s>
Encapsulation	O
can	O
also	O
be	O
implemented	O
at	O
the	O
network	O
level	O
,	O
by	O
having	O
outer	O
processes	B-Operating_System
protect	O
inner	O
ones	O
.	O
</s>
<s>
A	O
paper	O
by	O
C	O
.	O
Ellis	O
and	O
S	O
.	O
Gibbs	O
distinguishes	O
between	O
active	B-Operating_System
objects	I-Operating_System
and	O
passive	O
objects	O
.	O
</s>
<s>
Active	B-Operating_System
objects	I-Operating_System
on	O
the	O
other	O
hand	O
can	O
do	O
this	O
.	O
</s>
<s>
In	O
their	O
article	O
Ellis	O
and	O
Gibbs	O
state	O
that	O
active	B-Operating_System
objects	I-Operating_System
have	O
much	O
more	O
potential	O
for	O
the	O
development	O
of	O
maintainable	O
systems	O
than	O
do	O
passive	O
objects	O
.	O
</s>
<s>
An	O
FBP	O
application	O
can	O
be	O
viewed	O
as	O
a	O
combination	O
of	O
these	O
two	O
types	O
of	O
object	O
,	O
where	O
FBP	O
processes	B-Operating_System
would	O
correspond	O
to	O
active	B-Operating_System
objects	I-Operating_System
,	O
while	O
IPs	O
would	O
correspond	O
to	O
passive	O
objects	O
.	O
</s>
<s>
FBP	O
considers	O
Carl	O
Hewitt	O
's	O
Actor	O
as	O
an	O
asynchronous	O
processes	B-Operating_System
with	O
2	O
ports	O
:	O
one	O
for	O
input	O
messages	O
and	O
one	O
for	O
control	O
signals	O
.	O
</s>
