<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
data-driven	B-Application
programming	I-Application
is	O
a	O
programming	O
paradigm	O
in	O
which	O
the	O
program	O
statements	O
describe	O
the	O
data	O
to	O
be	O
matched	O
and	O
the	O
processing	O
required	O
rather	O
than	O
defining	O
a	O
sequence	O
of	O
steps	O
to	O
be	O
taken	O
.	O
</s>
<s>
Standard	O
examples	O
of	O
data-driven	O
languages	O
are	O
the	O
text-processing	O
languages	O
sed	B-Application
and	O
AWK	B-Application
,	O
and	O
the	O
document	O
transformation	O
language	O
XSLT	B-Application
,	O
where	O
the	O
data	O
is	O
a	O
sequence	O
of	O
lines	O
in	O
an	O
input	B-Architecture
stream	I-Architecture
–	O
these	O
are	O
thus	O
also	O
known	O
as	O
line-oriented	O
languages	O
–	O
and	O
pattern	O
matching	O
is	O
primarily	O
done	O
via	O
regular	B-Language
expressions	I-Language
or	O
line	O
numbers	O
.	O
</s>
<s>
Data-driven	B-Application
programming	I-Application
is	O
similar	O
to	O
event-driven	B-Application
programming	I-Application
,	O
in	O
that	O
both	O
are	O
structured	O
as	O
pattern	O
matching	O
and	O
resulting	O
processing	O
,	O
and	O
are	O
usually	O
implemented	O
by	O
a	O
main	B-General_Concept
loop	I-General_Concept
,	O
though	O
they	O
are	O
typically	O
applied	O
to	O
different	O
domains	O
.	O
</s>
<s>
The	O
condition/action	O
model	O
is	O
also	O
similar	O
to	O
aspect-oriented	B-Architecture
programming	I-Architecture
,	O
where	O
when	O
a	O
join	B-Application
point	I-Application
(	O
condition	O
)	O
is	O
reached	O
,	O
a	O
pointcut	B-Application
(	O
action	O
)	O
is	O
executed	O
.	O
</s>
<s>
A	O
similar	O
paradigm	O
is	O
used	O
in	O
some	O
tracing	O
frameworks	O
such	O
as	O
DTrace	B-Application
,	O
where	O
one	O
lists	O
probes	O
(	O
instrumentation	O
points	O
)	O
and	O
associated	O
actions	O
,	O
which	O
execute	O
when	O
the	O
condition	O
is	O
satisfied	O
.	O
</s>
<s>
Adapting	O
abstract	O
data	O
type	O
design	O
methods	O
to	O
object-oriented	B-Language
programming	I-Language
results	O
in	O
a	O
data-driven	O
design	O
.	O
</s>
<s>
This	O
type	O
of	O
design	O
is	O
sometimes	O
used	O
in	O
object-oriented	B-Language
programming	I-Language
to	O
define	O
classes	O
during	O
the	O
conception	O
of	O
a	O
piece	O
of	O
software	O
.	O
</s>
<s>
Data-driven	B-Application
programming	I-Application
is	O
typically	O
applied	O
to	O
streams	O
of	O
structured	O
data	O
,	O
for	O
filtering	O
,	O
transforming	O
,	O
aggregating	O
(	O
such	O
as	O
computing	O
statistics	O
)	O
,	O
or	O
calling	O
other	O
programs	O
.	O
</s>
<s>
Typical	O
streams	O
include	O
log	B-Application
files	I-Application
,	O
delimiter-separated	B-Protocol
values	I-Protocol
,	O
or	O
email	O
messages	O
,	O
notably	O
for	O
email	O
filtering	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
AWK	B-Application
program	O
may	O
take	O
as	O
input	O
a	O
stream	O
of	O
log	O
statements	O
,	O
and	O
for	O
example	O
send	O
all	O
to	O
the	O
console	O
,	O
write	O
ones	O
starting	O
with	O
WARNING	O
to	O
a	O
"	O
WARNING	O
"	O
file	O
,	O
and	O
send	O
an	O
email	O
to	O
a	O
sysadmin	B-Application
in	O
case	O
any	O
line	O
starts	O
with	O
"	O
ERROR	O
"	O
.	O
</s>
<s>
Alternatively	O
,	O
one	O
can	O
process	O
streams	O
of	O
delimiter-separated	B-Protocol
values	I-Protocol
,	O
processing	O
each	O
line	O
or	O
aggregated	O
lines	O
,	O
such	O
as	O
the	O
sum	O
or	O
max	O
.	O
</s>
<s>
In	O
email	O
,	O
a	O
language	O
like	O
procmail	B-Protocol
can	O
specify	O
conditions	O
to	O
match	O
on	O
some	O
emails	O
,	O
and	O
what	O
actions	O
to	O
take	O
(	O
deliver	O
,	O
bounce	O
,	O
discard	O
,	O
forward	O
,	O
etc	O
.	O
</s>
<s>
Some	O
data-driven	O
languages	O
are	O
Turing-complete	O
,	O
such	O
as	O
AWK	B-Application
and	O
even	O
sed	B-Application
,	O
while	O
others	O
are	O
intentionally	O
very	O
limited	O
,	O
notably	O
for	O
filtering	O
.	O
</s>
<s>
An	O
extreme	O
example	O
of	O
the	O
latter	O
is	O
pcap	B-Language
,	O
which	O
only	O
consists	O
of	O
filtering	O
,	O
with	O
the	O
only	O
action	O
being	O
“	O
capture	O
”	O
.	O
</s>
<s>
Data-driven	O
languages	O
frequently	O
have	O
a	O
default	O
action	O
:	O
if	O
no	O
condition	O
matches	O
,	O
line-oriented	O
languages	O
may	O
print	O
the	O
line	O
(	O
as	O
in	O
sed	B-Application
)	O
,	O
or	O
deliver	O
a	O
message	O
(	O
as	O
in	O
sieve	O
)	O
.	O
</s>
<s>
Functions	O
and	O
interfaces	B-Application
can	O
be	O
used	O
on	O
all	O
objects	O
with	O
the	O
same	O
data	O
fields	O
,	O
for	O
instance	O
the	O
object	O
's	O
"	O
position	O
"	O
.	O
</s>
<s>
While	O
data-driven	O
design	O
does	O
prevent	O
coupling	O
of	O
data	O
and	O
functionality	O
,	O
in	O
some	O
cases	O
,	O
data-driven	B-Application
programming	I-Application
has	O
been	O
argued	O
to	O
lead	O
to	O
bad	O
object-oriented	B-Application
design	I-Application
,	O
especially	O
when	O
dealing	O
with	O
more	O
abstract	O
data	O
.	O
</s>
<s>
This	O
is	O
because	O
a	O
purely	O
data-driven	O
object	O
or	O
entity	O
is	O
defined	O
by	O
the	O
way	O
it	O
is	O
represented	B-Application
.	O
</s>
<s>
If	O
an	O
intersection	O
(	O
in	O
the	O
United	O
States	O
)	O
is	O
represented	B-Application
in	O
data	O
by	O
the	O
zip	O
code	O
(	O
5-digit	O
number	O
)	O
and	O
two	O
street	O
names	O
(	O
strings	O
of	O
text	O
)	O
,	O
bugs	O
may	O
appear	O
when	O
a	O
city	O
where	O
streets	O
intersect	O
multiple	O
times	O
is	O
encountered	O
.	O
</s>
