When developing modules, you will identify services that multiple
modules can use. Leveraging services this way minimizes your development cycle
and costs. When you have a service used by many modules, you should isolate
the invoking modules from the target so that if the target is upgraded, switching
to the new service is transparent to the calling module. This topic contrasts
the simple invocation model and the isolated invocation model and provides
an example of how isolation can be useful. While describing a specific example,
this is not the only way to isolate modules from targets.
Isolated invocation model
To change the target of
an invocation without stopping invoking modules, you can isolate the invoking
modules from the target of the invocation. This allows the modules to continue
processing while you change the target because you are not changing the module
itself but the downstream target. Example of isolating applications shows how isolation
allows you to change the target without affecting the status of the invoking
module.
Example of isolating applications
Using
the simple invocation model, multiple modules invoking the same service would
look much like
Multiple applications invoking a single service . MODA,
MODB, and MODC all invoke CalculateFinalCost.
Figure 2. Multiple applications invoking a single service
The service provided by CalculateFinalCost needs updating
so that new costs are reflected in all modules that use the service. The development
team builds and tests a new service UpdatedCalculateFinal to incorporate the
changes. You are ready to bring the new service into production. Without isolation,
you would have to update all of the modules invoking CalculateFinalCost to
invoke UpdateCalculateFinal. With isolation, you only have to change the binding
that connects the buffer module to the target.
Note: Changing the service this
way allows you to continue to provide the original service to other modules
that may need it.
With this model, the invoking modules do not change,
you just have to change the binding from the buffer module import to the target
(see
Isolated
invocation model invoking UpdatedCalculateFinal).
Figure 4. Isolated invocation model invoking UpdatedCalculateFinal
If the buffer module invokes the target
synchronously, when you restart the buffer module (whether a mediation module
or a service for business module) the results returned to the original application
come from the new target. If the buffer module invokes the target asynchronously,
the results returned to the original application come from the new target
on the next invocation.