> I'm not sure what your question is. Do you
> mean that you want to get all customers plus their orders?
>> I'm not sure what your question is. Do you
>> mean that you want to get all customers plus their orders?
[quoted text clipped - 6 lines]
> it could not make a call per Customer reference returned from the Orders
> service as that would be prohibitively expensive.
I'm sorry, I don't believe in your scenario.
If customers and orders are unrelated concepts, then it could make sense for
them to be implemented in separate services which have no business logic in
common. These two services could be completely independent. In fact, they
could be implemented by companies that have never heard of each other.
But they're not unrelated concepts. Customers make Orders. Orders are
created on behalf of Customers. At a database level, chances are that the
Orders table has a CustomerID column that is has a foreign key relation to
the Customers table. In this environment, a simple JOIN in the database will
return a set of customers along with their orders, or they could be returned
as two separate rowsets with common filtering criteria.
Given that the database can relate the two concepts, why should the business
logic layer not relate them? And given that the business logic layer can
relate them, why should you not expose a web service that can return the
related entities?
Now, I'll try assuming that "Customers" and "Orders" are not the real
entities you're trying to manipulate, but rather are just for the sake of
example. In this case, it would probably be better to refer to them as
"Entity A" and "Entity B", in order to remove any preconceptions readers
might have based on calling them "Customers" and "Orders". Assume that the
two are not directly related, but rather that Entity A contains some data
that is not a key (a street address, for instance), and that Entity B also
contains this same non-key data (street address, again). Then there is an
implicit relationship between the two entities, though they might not be
aware of it. You might have to interpose a third piece of software that can
process the non-key data to produce a key from it. This "key" could be
manufactured against "Entity A" and "Entity B", and could then be used to
relate the two. *
In this case, you'll need an "aggregating" service that uses the "Entity A"
service and the "Entity B" service, runs it's key-manufacture algorithm on
the two non-key fields, matches the two manufactured keys, and returns
"Entity A" with the matched "Entity B".
Does that help at all, or were you asking a different kind of question when
you asked how would the function work? The brief answer is, "it would not
work as well as if the two entities were actually related".
I hope this isn't being done this way in service to some arbitrary mandate
about SOA. If it were, I'd say those who created the mandate misunderstand
SOA, which is about using appropriate services when they make sense, and not
when they don't make sense.

Signature
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer
* P.S. You'll have so much fun if you're dealing with something like a
street address, which may not resolve into a key with a single value, but
rather to a "fuzzy" key. This will give you approximate relationships
between the two entities, meaning that the match between them will be
approximately correct, but not quite.
Thomas - 05 Apr 2008 22:38 GMT
I thought it was obvious that the use of Customers and Orders was meant for
example purposes since I prefixed my original statement with "For example".
:->
Second, there may be very good reasons why they would separated into
multiple services. You may have multiple systems that use Customer data
across the entire enterprise. The Customers system may have been built prior
to the Order system being built and thus, the builders of the Order system
wanted to leverage the existing Customer data. However, we can use "Entity A"
and "Entity B" if it makes it easier for you to understand the problem.
One aspect of the problem that should be claified is that the "Entity A"
service is the authorative source for "A" Entities. In addition, the "Entity
A" service can provide a Key value which can be used to uniquely identify an
"A" entity. The reason I chose Customers and Orders is to imply that the
Customers service was an authoratative source for Customers and that Orders
had references to Customers from this service. Thus, we should assume that
the "Entity B" service needs some way of referencing an "Entity A" instance
which it could using this "Entity A" key value. I'm not sure if this implies
an "implicit" reference in your parlance.
Where this scenario rears its head is reporting. In my current project, we
are building a suite of (web) applications that require interoperability.
There are situations in each applications where it would be handy to
reference the authoritative source application of a given piece of data. On
the entry side, services work well for this. However, I have not figured out
how this would be managed on the reporting side when a user runs a report
from Application B that would show data referenced data from Application A
without doing it directly at the data layer via views.
If we determine that an aggregator service is required, I'm wondering how
that service would be constructed. How have other people dealt with this
problem of reporting against multiple services?