Java Reference
In-Depth Information
Figure 10.24
As this server error demonstrates, SCA's WSDL binding only works well for services whose
interfaces are restricted to using primitive types.
The difficulty comes when you try to implement a
FoodAdapter.
By necessity, it will
depend on a
FoodImpl
implementation class, which leaves the
SpecialOffer
interface with a dependency on an implementation class. If you're getting into the
OSG
i spirit of things, this should leave you feeling like you haven't brushed your
teeth in a week.
A much more
OSG
i-centric solution to the problem is to wrapper the complex
SpecialOffer
service with a simpler
PrimitiveOffer
service for the purpose of distri-
bution. A Blueprint reference listener can be used to track
PrimitiveOffer
services.
The listener would automatically detect and consume each bound
PrimitiveOffer
service, and use it to generate and register a wrapper
SpecialOffer
service. But this
significantly increases the complexity of using
SCA
for service remoting.
Does this mean you shouldn't use
SCA
for remoting your
OSG
i services? Not neces-
sarily. Although we haven't provided a detailed example,
SCA
does provide support for
distributed transactions, which may be critical to your application. Furthermore, as
you'll see in chapter 11,
SCA
offers a lot more than remote services. You may find
SCA
remote services fit neatly into a broader
SCA
-based architecture. If your application
server includes
SCA
, you can bypass the hand-assembly of your stack that we described
earlier. And if your service interfaces are already based around primitives and Strings,
you won't need to worry about rewriting services to avoid the use of complex types.
10.7
Summary
Remoting is generally considered to be one of the more difficult parts of enterprise
programming. We hope that you can now see how the intrinsic dynamism and modu-
larity of an
OSG
i framework dramatically simplifies this situation. Not only does
OSG
i
lend itself to a remote model, but it also provides simple, easily reusable remoting
