3.
Consider
the
earlier
tutorial
about
writing
the
Java
code
for
a
game
of
Tic-Tac-Toe.
We
are
now
interested
in
translating
this
bridge
game
into
a
different
programming
langauge
by
implementing
a
new
interface
but
retaining
the
gameplay
logic
and
as
much
other
code
as
possible.
Which
design
pattern
would
you
use?
Draw
a
UML
class
diagram
relating
the
objects
in
the
new
and
old
game
together.
4. Consider
the
following
design
goals.
Indicate
the
candidate
pattern(s)
you
would
consider
to
satisfy
each
goal:
Given
a
legacy
banking
application,
encapsulate
the
existing
business
logic
component.
Given
a
chess
program,
enable
future
developers
to
substitute
the
planning
algorithm
that
decides
on
the
next
move
with
a
better
one.
Given
a
chess
program,
enable
a
monitoring
component
to
switch
planning
algorithms
at
runtime,
based
on
the
opposing
players
style
and
response
time
5.
Consider
an
application
that
must
select
dynamically
an
encryption
algorithm
based
on
security
requirements
and
computing
time
constraints.
Which
design
pattern
would
you
select?
Draw
a
UML
class
diagram
depicting
the
classes
in
the
pattern
and
justify
your
choice
6.
Compare
and
contrast
between
the
observer
design
pattern
and
the
listeners
implemented
in
Java
libraries
(i.e.
MouseListener,
ActionListener
etc.)
7.
You
are
tasked
to
writing
the
software
logic
for
controlling
a
electronic
hand
dryer.
The
dryer
has
a
IR
sensor
which
can
determine
whenever
someone's
hands
are
placed
under
it.
This
triggers
the
dryer
to
start
blowing
hot
air
for
a
fixed
amount
of
time.
The
dryer
can
also
be
triggered
via
a
push
button
on
the
front
of
the
unit.
Once
the
unit
starts
blowing,
we
do
not
want
additional
button
pushes
or
triggers
of
the
light
sensor
to
extend
the
air
blowing
cycle.
Select
the
most
appropriate
design
pattern
to
use
to
address
the
problem
and
show
how
it
is
applied.
Show
an
appropriate
class
diagram(s)
and
enough
code
fragments
to
illustrate
your
use
of
the
pattern
to
solve
the
problem.
8.
The
faade
and
observer
patterns
were
listed
to
reduce
coupling
between
objects.
Discuss
how
the
use
of
these
patterns
reduce
coupling.
NOTE
:
additional
reference
for
design
patterns
http://www.tutorialspoint.com/design_pattern/index.htm
https://thenewcircle.com/static/bookshelf/java_fundamentals_tutorial/index.html
http://www.oodesign.com/
TCP2201-T11/2014.15/WKS