<s>
Event-driven	B-Application
architecture	I-Application
(	O
EDA	O
)	O
is	O
a	O
software	B-Architecture
architecture	I-Architecture
paradigm	O
promoting	O
the	O
production	O
,	O
detection	O
,	O
consumption	O
of	O
,	O
and	O
reaction	O
to	O
events	O
.	O
</s>
<s>
An	O
event	O
can	O
be	O
defined	O
as	O
"	O
a	O
significant	O
change	O
in	O
state	B-Application
"	O
.	O
</s>
<s>
For	O
example	O
,	O
when	O
a	O
consumer	O
purchases	O
a	O
car	O
,	O
the	O
car	O
's	O
state	B-Application
changes	O
from	O
"	O
for	O
sale	O
"	O
to	O
"	O
sold	O
"	O
.	O
</s>
<s>
A	O
car	O
dealer	O
's	O
system	O
architecture	O
may	O
treat	O
this	O
state	B-Application
change	O
as	O
an	O
event	O
whose	O
occurrence	O
can	O
be	O
made	O
known	O
to	O
other	O
applications	O
within	O
the	O
architecture	O
.	O
</s>
<s>
From	O
a	O
formal	O
perspective	O
,	O
what	O
is	O
produced	O
,	O
published	O
,	O
propagated	O
,	O
detected	O
or	O
consumed	O
is	O
a	O
(	O
typically	O
asynchronous	O
)	O
message	O
called	O
the	O
event	O
notification	O
,	O
and	O
not	O
the	O
event	O
itself	O
,	O
which	O
is	O
the	O
state	B-Application
change	O
that	O
triggered	O
the	O
message	O
emission	O
.	O
</s>
<s>
This	O
is	O
due	O
to	O
Event-driven	B-Application
architectures	I-Application
often	O
being	O
designed	O
atop	O
message-driven	O
architectures	O
,	O
where	O
such	O
communication	O
pattern	O
requires	O
one	O
of	O
the	O
inputs	O
to	O
be	O
text-only	O
,	O
the	O
message	O
,	O
to	O
differentiate	O
how	O
each	O
communication	O
should	O
be	O
handled	O
.	O
</s>
<s>
This	O
architectural	O
pattern	O
may	O
be	O
applied	O
by	O
the	O
design	O
and	O
implementation	O
of	O
applications	O
and	O
systems	O
that	O
transmit	O
events	O
among	O
loosely	B-Application
coupled	I-Application
software	I-Application
components	I-Application
and	O
services	O
.	O
</s>
<s>
The	O
physical	O
implementation	O
of	O
event	O
channels	O
can	O
be	O
based	O
on	O
traditional	O
components	O
such	O
as	O
message-oriented	B-Application
middleware	I-Application
or	O
point-to-point	O
communication	O
which	O
might	O
require	O
a	O
more	O
appropriate	O
.	O
</s>
<s>
Building	O
systems	O
around	O
an	O
event-driven	B-Application
architecture	I-Application
simplifies	O
horizontal	O
scalability	O
in	O
distributed	B-Architecture
computing	I-Architecture
models	O
and	O
makes	O
them	O
more	O
resilient	O
to	O
failure	O
.	O
</s>
<s>
This	O
is	O
because	O
application	B-Application
state	I-Application
can	O
be	O
copied	O
across	O
multiple	O
parallel	O
snapshots	O
for	O
high-availability	O
.	O
</s>
<s>
Adding	O
extra	O
nodes	O
becomes	O
trivial	O
as	O
well	O
:	O
you	O
can	O
simply	O
take	O
a	O
copy	O
of	O
the	O
application	B-Application
state	I-Application
,	O
feed	O
it	O
a	O
stream	O
of	O
events	O
and	O
run	O
with	O
it	O
.	O
</s>
<s>
Event-driven	B-Application
architecture	I-Application
can	O
complement	O
service-oriented	O
architecture	O
(	O
SOA	O
)	O
because	O
services	O
can	O
be	O
activated	O
by	O
triggers	O
fired	O
on	O
incoming	O
events	O
.	O
</s>
<s>
This	O
new	O
business	B-General_Concept
intelligence	I-General_Concept
pattern	O
triggers	O
further	O
autonomous	O
human	O
or	O
automated	O
processing	O
that	O
adds	O
exponential	O
value	O
to	O
the	O
enterprise	O
by	O
injecting	O
value-added	O
information	O
into	O
the	O
recognized	O
pattern	O
which	O
could	O
not	O
have	O
been	O
achieved	O
previously	O
.	O
</s>
<s>
The	O
event	O
body	O
provides	O
the	O
details	O
of	O
the	O
state	B-Application
change	O
detected	O
.	O
</s>
<s>
An	O
event	B-Application
driven	I-Application
architecture	I-Application
may	O
be	O
built	O
on	O
four	O
logical	O
layers	O
,	O
starting	O
with	O
the	O
sensing	O
of	O
an	O
event	O
(	O
i.e.	O
,	O
a	O
significant	O
temporal	O
state	B-Application
or	O
fact	O
)	O
,	O
proceeding	O
to	O
the	O
creation	O
of	O
its	O
technical	O
representation	O
in	O
the	O
form	O
of	O
an	O
event	O
structure	O
and	O
ending	O
with	O
a	O
non-empty	O
set	O
of	O
reactions	O
to	O
that	O
event	O
.	O
</s>
<s>
Usually	O
,	O
because	O
the	O
event	B-Operating_System
processing	I-Operating_System
engine	O
has	O
to	O
process	O
them	O
in	O
near	O
real	O
time	O
,	O
the	O
event	O
channels	O
will	O
be	O
read	O
asynchronously	O
.	O
</s>
<s>
The	O
events	O
are	O
stored	O
in	O
a	O
queue	O
,	O
waiting	O
to	O
be	O
processed	O
later	O
by	O
the	O
event	B-Operating_System
processing	I-Operating_System
engine	O
.	O
</s>
<s>
The	O
event	B-Operating_System
processing	I-Operating_System
engine	O
is	O
the	O
logical	O
layer	O
responsible	O
for	O
identifying	O
an	O
event	O
,	O
and	O
then	O
selecting	O
and	O
executing	O
the	O
appropriate	O
reaction	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
the	O
event	O
that	O
comes	O
into	O
the	O
event	B-Operating_System
processing	I-Operating_System
engine	O
is	O
a	O
product	O
ID	O
low	O
in	O
stock	O
,	O
this	O
may	O
trigger	O
reactions	O
such	O
as	O
“	O
Order	O
product	O
ID	O
”	O
and	O
“	O
Notify	O
personnel	O
”	O
.	O
</s>
<s>
Depending	O
on	O
the	O
level	O
of	O
automation	O
provided	O
by	O
the	O
sink	O
(	O
event	B-Operating_System
processing	I-Operating_System
engine	O
)	O
the	O
downstream	O
activity	O
might	O
not	O
be	O
required	O
.	O
</s>
<s>
There	O
are	O
three	O
general	O
styles	O
of	O
event	B-Operating_System
processing	I-Operating_System
:	O
simple	O
,	O
stream	O
,	O
and	O
complex	O
.	O
</s>
<s>
The	O
three	O
styles	O
are	O
often	O
used	O
together	O
in	O
a	O
mature	O
event-driven	B-Application
architecture	I-Application
.	O
</s>
<s>
Simple	O
event	B-Operating_System
processing	I-Operating_System
concerns	O
events	O
that	O
are	O
directly	O
related	O
to	O
specific	O
,	O
measurable	O
changes	O
of	O
condition	O
.	O
</s>
<s>
In	O
simple	O
event	B-Operating_System
processing	I-Operating_System
,	O
a	O
notable	O
event	O
happens	O
which	O
initiates	O
downstream	O
action(s )	O
.	O
</s>
<s>
Simple	O
event	B-Operating_System
processing	I-Operating_System
is	O
commonly	O
used	O
to	O
drive	O
the	O
real-time	O
flow	O
of	O
work	O
,	O
thereby	O
reducing	O
lag	O
time	O
and	O
cost	O
.	O
</s>
<s>
The	O
car	O
's	O
tire	O
incorrect	O
pressure	O
will	O
generate	O
a	O
simple	O
event	O
from	O
the	O
sensor	O
that	O
will	O
trigger	O
a	O
yellow	O
light	O
advising	O
the	O
driver	O
about	O
the	O
state	B-Application
of	O
a	O
tire	O
.	O
</s>
<s>
In	O
event	B-Application
stream	I-Application
processing	I-Application
(	O
ESP	O
)	O
,	O
both	O
ordinary	O
and	O
notable	O
events	O
happen	O
.	O
</s>
<s>
Event	B-Application
stream	I-Application
processing	I-Application
is	O
commonly	O
used	O
to	O
drive	O
the	O
real-time	O
flow	O
of	O
information	O
in	O
and	O
around	O
the	O
enterprise	O
,	O
which	O
enables	O
in-time	O
decision	O
making	O
.	O
</s>
<s>
Complex	B-Operating_System
event	I-Operating_System
processing	I-Operating_System
(	O
CEP	O
)	O
allows	O
patterns	O
of	O
simple	O
and	O
ordinary	O
events	O
to	O
be	O
considered	O
to	O
infer	O
that	O
a	O
complex	O
event	O
has	O
occurred	O
.	O
</s>
<s>
Complex	B-Operating_System
event	I-Operating_System
processing	I-Operating_System
evaluates	O
a	O
confluence	O
of	O
events	O
and	O
then	O
takes	O
action	O
.	O
</s>
<s>
Online	O
event	B-Operating_System
processing	I-Operating_System
(	O
OLEP	O
)	O
uses	O
asynchronous	O
distributed	O
event-logs	O
to	O
process	O
complex	O
events	O
and	O
manage	O
persistent	O
data	O
.	O
</s>
<s>
An	O
event	B-Application
driven	I-Application
architecture	I-Application
is	O
extremely	O
loosely	B-Application
coupled	I-Application
and	O
well	O
distributed	O
.	O
</s>
<s>
The	O
architecture	O
is	O
extremely	O
loosely	B-Application
coupled	I-Application
because	O
the	O
event	O
itself	O
does	O
n't	O
know	O
about	O
the	O
consequences	O
of	O
its	O
cause	O
.	O
</s>
<s>
Event	B-Application
driven	I-Application
architectures	I-Application
have	O
loose	B-Application
coupling	I-Application
within	O
space	O
,	O
time	O
and	O
synchronization	O
,	O
providing	O
a	O
scalable	O
infrastructure	O
for	O
information	O
exchange	O
and	O
distributed	O
workflows	O
.	O
</s>
<s>
The	O
Java	B-Language
Swing	I-Language
API	O
is	O
based	O
on	O
an	O
event	B-Application
driven	I-Application
architecture	I-Application
.	O
</s>
<s>
This	O
works	O
particularly	O
well	O
with	O
the	O
motivation	O
behind	O
Swing	B-Language
to	O
provide	O
user	O
interface	O
related	O
components	O
and	O
functionality	O
.	O
</s>
<s>
Alternatively	O
,	O
another	O
implementation	O
choice	O
is	O
to	O
add	O
the	O
listener	O
to	O
the	O
object	O
as	O
an	O
anonymous	O
class	O
and	O
thus	O
use	O
the	O
lambda	O
notation	O
(	O
since	O
Java	B-Language
1.8	O
)	O
.	O
</s>
<s>
Events	O
are	O
one	O
of	O
the	O
fundamental	O
elements	O
of	O
the	O
Object	B-Language
Pascal	I-Language
language	O
.	O
</s>
