[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [asap] Factory in ASAP
That
should be relatively easy:
I
think this allows you to start an asynchronous service with an observer key that
will receive multiple responses. For example the real-estate agent home
search example that sends back a result everytime a new home is listed that
meets the criteria.
Further Reflections - the case for fixed operation
names
Often,
we have been asked the question: "why do I need to give the operation a
particular name, and why must there be an instance key? I should be able
to name the operation anything I want. The instance key is just a
correlation key. I should be able to make any field in the message be the
correlation key. For example, I have a field named 'PO Number' that that
can be the correlation value; or I should even be able to make the correlation
be a combination of values, such as 'Telephone Number' and 'First
Name'."
What
drives us to this approach is that we need to be able to link systems together
easily. Consider an analogy: the Java Servlet class. I order to make
it easy to add programming functionality easily into a web environment, the
Servlet interface was invented. You implement a class to this
interface. Most important is a single method "service" which accepts two
parameters: ServletRequest and ServletResponse. Using the servlet
interface, you can easily make a Java program that generates a page however you
want it: a list of hot stocks, a discussion forum, a check-in/check-out document
management system, whatever.
The
cool thing about implementing a class with this interface is that the only thing
that must be done is to let the Servlet engine know the name of the class, and
the address to map it to. (In some cases it can make a mapping
automatically by the class name, and you only need to let it know the class
name.) Knowing the class name, it can make an instance of the class, and
call "service" on it.
One
might argue: "Wait a minute, I am writing an On-Line Go Program, so I should be
able to use an operation like 'MakeMove' instead of 'service'". You
might even argue that you have written many Go programs in the past, and never
had to use a method named 'service'. True enough. But to make it
easy for the web server, you take whatever functionality you want called, and
bundle it up into method called 'service' so that the Servlet engine knows what
method to call. We can conceive of a system that allows the Servlet engine
to call any method, of course. But if we do that, we need to (a) tell the
engine the name of the class, (b) tell it the name of the method, (c) tell it
about each paramter and what to send there (this is the hard part). The
Servlet engine has a Servlet Request class and a Servlet Response class, but in
this alternative approach it needs to be told how to draw information out of
those structure, and reoragnize it into the structures required for the 'make
move' operation. It just is not worth externalizing this
information. Instead, we internalize how to get the move information from
the ServletRequest class. We ask the Servlet designer to offer a plain
vanilla interface that any servlet engine can call. The only setup is
specifying the name of the class. Simple, and very
effective.
This
is essentially what we are doing with ASAP. I can make a web service
"PurchaseItem" which has 5 parameters to it, but then I have to teach the
calling program the meaning of the 5 parameters. Every company might do
these parameters differently.
Imagine I have a local purchase order system where I enter things I want
to purchase, then the local system figures out that the things I am purchasing
can be split into three groups and each group ordered from a different
store. (e.g. an office supply store, a computer store, a phone
company) An order will be submitted to each of the three, and they will
take the order through their process. It is certainly possible to let each
of the three stores define their own Web Service operation for submitting an
order. EAch of them would have their own different parameters to the
operation. Then, on of them will have a correlation ID called "Order Num",
the next will have "CondactId", and the last uses a combination of "Account
Number" and "Sequence Id".
I am a
programmer, so I know that I can write a system that can make a call to any Web
Service, and transform my internal information in any way necessary, and
then I can store any structure that returns, so it is possible to make this
work. (Fujitsu's i-Flow system dow this.) BUT, look at all the
trouble I have to go to. Every external system that calls the office
supply system needs to be told that "OrderNum" is the important value that must
be stored and then used again for futher requests. Think how much easier
it is to set up a standard that all correlation information is collected into a
single field called "InstanceKey" which is a URL. Now the office supply
company may make that URL look something like this:
"xxx/yyy/zzz.jsp?OrderNum=12345". The calling system does not need to know
anything about the structure of this, just simply to return the value
back. The phone company can structure their instance key as
"xxx/yyy/zzz.jsp?AccountNo=12345&SequenceId=678". Now, the calling
program simply needs to save the InstanceKey for each of the stores, and hand
the same one back. It does not need to know how that key was
constructed.
The
important aspect is that the calling system knows that
it needs an id to return on subsequent requests. That is all it needs
to know. The details of how to find and track instances is kept internal
to the system being called. We are asking these system to implement a
service according to a fixed interface defined by the standard. By
implementing this interface, it become very easy to link together
systems.
Keeping the details on how instances are found internal to the remote
service is important not only because it simplifies the life of the caller, but
also because it allows for flexibility over time. The phone company may
decide later to track orders by 9 digit zip code and time/date of first
contact. At any point in time, it can make that change by generating new
service instances with the new instance key format. There may be hundreds
or thousands of client set up to be able to call this service at the telephone
company, but they do not need to change a thing. They still receive an
instance key, and they return it back, without having to know anything about how
the phone company stores their information.
-Keith
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]