IBM WebSphere Adapters Network Card User Manual


 
Adapters are responsible for creating, updating, retrieving, and deleting (CRUD)
records in the EIS system based on the structure described by the incoming
metadata and the content in the incoming cursor. The command pattern approach
is recommended for handling the generic processing of CRUD operations for
After-Image as well as Delta scenarios.
For example, if an incoming cursor represents an after-image update, the adapter
must take steps to update the EIS such that the corresponding object in the EIS
matches the structure and contents of the cursor request. To accomplish this, the
adapter retrieves the structure in the EIS system, then compares it to the incoming
cursor. The adapter then performs the operations necessary to make the EIS system
match the input. These operations are typically performed as the comparisons
occur. This makes adapter processing potentially quite complex. A command
pattern capability abstracts this functionality into generic logic, thereby saving
adapter developers time and effort.
The command pattern breaks down a hierarchical update into a hierarchy of small
sub-commands. These sub-commands are passed to an interpreter, which retrieves
and executes the code necessary to perform the sub-command on that particular
EIS system. This makes it possible for the adapter developer to deal with
operations on single-tier entities without having to walk the structure and
compare. This has the potential to simplify adapter construction greatly because
the comparison routines can be generic.
Advantages of the command pattern include:
v Code Reuse: The only code that the adapter developer would need to write
would be the EIS-specific operations: the comparator and interpreter code would
be common components.
v Performance consistency: Because adapters make use of common components,
developers can rigorously define the after-image update process, making a
variety of adapters work more consistently.
v Adapter phantom mode capability: If operations must be performed, the
interpreter can easily be turned off, with the contents of the command hierarchy
dumped to a file instead.
Command Manager:
The Command Manager is a utility designed to reduce complexity when dealing
with delta and snapshot hierarchical objects. You use the Command Manager to
consolidate the code necessary to deal with these objects, breaking down the
structure into nodes, then creating commands that can deal with each node.
Snapshot objects
Consider the simple case of a snapshot Create operation involving a structure that
you want to create inside the EIS. The Command Manager creates a command
structure composed of Create commands that is based on the incoming structure.
This command structure will then be executed by the interpreter. As the interpreter
executes each individual command, the assigned objects are created.
With a snapshot Update, the Command Manager must retrieve the object from the
EIS, compare it to the incoming structure and create a command structure that can
change the data in the EIS to match the incoming structure.
106 WebSphere Adapters: WebSphere Adapter Toolkit User Guide