The Source for Java Technology Collaboration
User: Password:



Michael Champion's Blog

June 2003 Archives


SOA: One acronym to bind them all?

Posted by mchampion on June 24, 2003 at 07:31 PM | Permalink | Comments (6)

I must confess that when I first started hearing about Service Oriented Architectures or SOAs, my reaction was "oh brother, here we go again ... more vague mumbling about 'paradigm shifts' by analysts who have predicted 10 of the last 2 revolutions." The definitions one finds didn't inspire confidence ... usually something along the lines of "a SOA is an architecture in which the components are services and the services interact by invoking other services." Sortof begs the question of what a "service" is.

Another thing that did not inspire confidence was that many people who profoundly disagree about lots of other things all seem to agree that Service Oriented Architectures are a Good Thing. If the term is broad enough to include "everything", is it meaningful enough to exclude anything?

I've overcome a good bit of this cynicism lately. Sure, SOA is a kindof fuzzy concept, but after spending much of the last year trying to rigorously define what a Web service really is and is not, I'm more sympathetic to the recursive use of "servce" in these definitions. Likewise, a lot of the discussion blurs the distinction between the definition of SOA and the characteristics of good architectures, service oriented or otherwise. For example, "loosely coupled" and "standards based" are considered two of the pillars of SOA". These seem more like principles of most successful architectures than principles specific to SOA. But there does seem to be a very powerful idea buried down in the current SOA hype: the idea that the central abstraction is this fuzzy thing called "service."

It's hard to define what a "service" is -- it could be some software component written in an OO language and deployed via an application server, or some "glue" exposing a legacy mass of COBOL , or a plain vanilla Web server providing the, uhh, service of serving up documents. But it's a lot less hard to talk about how one invokes a "service" -- you always (I think!) send it messages. So, to implement a "service," take some discrete chunk of functionality and provide a messaging interface to it. All that consumers of the service have to know to use it is the format of the messages they send it and get back from it, the protocol(s) for transmitting the messages, and the "message exchange pattern" of the interaction between the service provider and service consumer. In other words, the critical definition of a service is its interface to its consumers, not any particular characteristic of its design, implementation, deployment, etc. One can develop SOAs with COM, CORBA, BEEP, JMS, proprietary stuff, XML, HTTP, SOAP, and all sorts of combinations of these and many other technologies. One can describe the service interface using some combination of IDL, WSDL, an XML schema language (there are several!), DAML-S or some other ontology language, or if all else fails, a phone conversation.

This, in my mind anyway, explains why so many people who disagree on other things tend to think of their architectures as "service oriented." What they're disagreeing about are things like whether to encapsuate the service invocation messages behind an API or expose the messages directly to the service consumer, whether to handle reliabiility and transaction integrity down in the service infrastructure or up in the application layer, whether to have the service semantics described by human-readable documents or machine-processable ontologies, and so on. But if one looks at the messages, exchange patterns, and data exchanged, a lot of these differences tend to blur into the background.

I think this view of distributed systems architectures helps maintain focus on what is important for scalability, interoperability, evolveability, etc. and prevents us from becoming distracted by extraneous and politically loaded concerns. For example, there is no intrinsic conflict betweeen REST and SOA or SOAP. One can and should debate the specific conditions under which it makes more sense to directly manipulate "resources" by transferring representations of their state using the "services" supplied by HTTP, and when it makes more sense to hide the resources behind a more complex and customized service interface, but let's not call these alternative "paradigms". They're just different flavors of SOA, and developers are free to mix and match them to meet the needs of a distributed application.



When does SOAP add value over simple HTTP+XML?

Posted by mchampion on June 13, 2003 at 11:04 AM | Permalink | Comments (5)

Sean McGrath seems to be the first to link to this weblog, and I'll return the favor by publicly disagreeing with him <grin>. Actually, there's not a whole lot in the XML world that Sean an I disagree about, I strongly recommend his ITWorld columns . But apparently the benefits of SOAP are one of them, as he says: " I would argue that it is not the case that for more complex apps, SOAP is better. Sure, there comes a point where you cannot encode parameters into a URI but I don't see why it follows that these more complex web services need to throw out the huge advantages of having a GETable URI."

First, as of SOAP 1.2 (very soon to be a W3C Recommendation) there is no conflict between SOAP and "having a GETable URI." SOAP has a web method feature:

Bindings to HTTP or such other protocols SHOULD use the SOAP Web Method feature to give applications control over the Web methods to be used when sending a SOAP message.

In short, SOAP 1.2 allows and encourages the use of HTTP GET to invoke services that simply return data, thus allowing one to hyperlink to SOAP services, exploit HTTP caches of the results of frequently-accessed services, etc.

But, one might ask (and people very frequently do!), what benefit does one get from SOAP if just GETing or POSTing XML data works just fine in your application? One very reasonable answer is "not much." Sure, once WSDL 1.2 (which wll support the web method feature in SOAP) is out we can expect tools to make it very easy to generate programming language code to invoke "GETable URI" SOAP services, but that is in the future sometime. A better answer, I think is that SOAP provides an architectural foundation for extended services as requirements evolve.

For example, "raw XML over HTTP" works just fine for simple services over a secure intranet (or the public internet when SSL provides adequate security). But what happens as the requirements on the service creep upwards and one must: support:

  • Routiing and reliable messaging across multi-node networks, such as when one must perform content-based routing from an HTTP gateway to the appropriate back-end service (e.g., the one nearest to the consumer).
  • End to end encryption (from consuming application to service rather from consuming application to SSL gateway)
  • integration of legacy services that may not have an HTTP URI
  • Non-HTTP communications protocols and interfaces such as BEEP, MQ and JMS
  • Multipart service transactions that must be committed or rolled-back/compensated as an entity
  • More complex interactions between service suppliers and consumers that need to be described and choreographed.

So, if you are likely to have some of these challenges, building SOAP into the architecture lets you leverage emerging technologies such as WS-Security, WS-Routing, one of the several reliable messaging proposals, WS-Transaction, WSBPEL, etc. that build on the SOAP infrastructure.

If, on the other hand, you are saying to yourself "that's WAY more complicated than anything I want to do," then SOAP may not be for you. Likewise, if you are saying "I need to do that stuff MY way rather than the way some industry committee's way," then perhaps you are better off putting this stuff into your own application rather then buying an off-the-shelf solution, and SOAP doesn't offer anything you need. But this is something to be analyzed -- it's just as "wrong" to blindly reject SOAP as to blindly accept. it.

Still, at a more fundamental level I think Sean and I agree on the basic architectural principle here :"I have learned to really appreciate the power of the "distributed systems as stateless document exchange," which I believe lies at the heart of what makes HTTP so stunningly successful. " It often makes more sense to think of XML-powered applications as transformation pipelines (see Propylon's PropelX and Software AG's EntireX Mediator as pioneering tools that support this approach) rather than objects to be exposed with APIs. More on this in a future edition ...but in either scenario, SOAP may add enough value to justify its use.



Exploring Where XML and Java Meet

Posted by mchampion on June 10, 2003 at 04:07 PM | Permalink | Comments (1)

For some users, the Java and XML roads come together in a smooth interchange where objects can be serialized as XML and schemas cleanly bound into classes. But for others, they come together in a maze of alternative sidestreets, and there are a lot of interesting things happening there that one one misses by simply taking the "databinding interchange." The overall theme of this weblog is to explore some of the sidestreets in the "place" where XML, Java, and related technologies such as DBMS and Web services meet, and sometimes look into the dark alleys leading off them. I plan to use this weblog as a forum in which to point to interesting ideas and generate discussions about them, so please contribute thoughts, corrections, commentary, and suggestions.

To start things off, there has been a spate of articles lately related to something I've wondered about for a long time, namely the relationship of the world of objects to the world of XML. On one hand, the OO principle of "data hiding" suggests treating the details of data formats as implementation details to be hidden behind access methods -- relates to the world of XML. The whole point of XML is to expose the data rather than to hide it. Norm Walsh emphasizes the point that "XML is Not Object Oriented," pointing out that:

the constituent elements and attributes of an XML vocabulary are not generally related to each other by inheritance, nor do they naturally correspond to objects with any kind of precision.

On the other hand, XML makes an awfully handy serialization format for Java objects.Also, there is a generic XML object model that has much support in the Java world and provides a useful, if very low-level, set of methods for working with XML documents.

So, as the old joke goes, XML really is a bit of a "floor wax and a dessert topping." The trick is to know which approaches, tools, APIs, etc. are best for which applications. That is a subject we will explore in subsequent editions of this weblog.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds