links between the
FACADE
and the other subsystem. However, if the
FACADE
can
be integrated
directly with the other subsystem, then a good option is to put the communication link
between the
ADAPTER
and
FACADE
, because the protocol of the
FACADE
is presumably simpler
than what it covers. There also will be cases where the entire
ANTICORRUPTION LAYER
can live
with the other subsystem, placing communication links or distribution mechanisms between
your subsystem and the
SERVICES
that make up the
ANTICORRUPTION LAYER
's interface. These
are implementation and deployment decisions to be made pragmatically. They have no
bearing on the conceptual role of the
ANTICORRUPTION LAYER
.
If you do have
access to the other subsystem, you may find that a little refactoring over
there can make your job easier. In particular, try to write more explicit interfaces for the
functionality you'll be using, starting with automated tests, if possible.
Where integration
requirements are extensive, the cost of translation goes way up. It may be
necessary to make choices in the model of the system under design that keep it closer to the
external system, in order to make translation easier. Do this very carefully, without
compromising the integrity of the model. It is only something to do selectively when
translation difficulty gets out of hand. If this approach seems the
most natural solution for
much of the important part of the problem, consider making your subsystem a
CONFORMIST
pattern, eliminating translation.
If the other subsystem is simple or has a clean interface, you may not need the
FACADE
.
Functionality can be added to the
ANTICORRUPTION LAYER
if it is
specific to the relationship of
the two subsystems
. An audit trail for use of the external system or trace logic for debugging
the calls to the other interface are two useful features that come to mind.
Remember, an
ANTICORRUPTION LAYER
is a means of linking two
BOUNDED CONTEXTS
. Ordinarily, we
are thinking of a
system created by someone else; we have incomplete understanding of the
system and little control over it. But that is not the only situation where you need a little padding
between subsystems. There are even situations in which it makes sense to connect two
subsystems of your own design with an
ANTICORRUPTION LAYER
, if they are based on different
models. Presumably,
in such a case, you will have full control over both sides and typically can use
a simple translation layer. However, if two
BOUNDED CONTEXTS
have gone
SEPARATE WAYS
yet still
have some need of functional integration, an
ANTICORRUPTION LAYER
can reduce the friction
between them.
Do'stlaringiz bilan baham: