Databases Reference
In-Depth Information
If we want to route the operation based on the content of the message, then this
should also be done in the virtual layer.
If we need to modify the endpoint that a composite invokes, then this is defined in an
external reference (regardless of whether we go via a Mediator or not).
So all that we are left with is validation. When you consider that it is the composite
that is responsible for creating the data, you would hope that in most cases, we could
be confident that we were creating our own valid data (in cases where we were not,
then this, of course, is a valid pattern).
Using a composite as a virtual service
With the above in mind, the real question we should have asked is:
Are there any scenarios where we would use a composite (based on a Mediator) to
implement a virtual service?
Recall that a composite application is a collection of related composites, that is, they
have been designed and implemented as part of the same solution.
With this in mind, a scenario that we usually want to avoid is where we have a
composite calling another composite (in the same application) via the Service Bus.
This is because it will typically add an additional layer of complexity, as well as the
overhead of marshalling and un-marshalling a message between the SOA infrastructure,
which in the case of a simple synchronous call, would need to happen four times.
The first time for the hop from the calling composite in the service
infrastructure to the Service Bus, the second for the hop from the Service
Bus back to the invoked composite on the service infrastructure and then
another two hops to return the response.
A typical scenario where this could occur is where we have a composite business
service which needs to invoke some logic on an external system via a technology
adapter (such as the database, file, or FTP adapter).
One way to implement this would be to build a simple composite that references the
external system via the appropriate adapter. We could then plug this into the Oracle
Service Bus (as a business service) and then use a proxy service to expose this as a
virtual service, which could then be invoked by our composite business service.
This (in the absence of any other requirements) is clearly an overly complicated
solution and a classic example of when we would use a Mediator in the same
composite as the adapter to expose it as an internal virtual service.
 
Search WWH ::




Custom Search