The role of objects in service-oriented systems

Jon Fancey commented on my last post about OO and SO:

Dude, I agree with you 100%. I share your fear; like I think I said at the XML Dev Con though, I can't help feeling that with >6m developers on the planet and 100 people at the conference that what we say as a 'closed' group is largely irrelevant. I refuse to think like that because it's too depressing but come on, what is Indigo if it isn't a replacement for COM and .net remoting? Everyone is making Web services look to the developer like the next distributed object ecosystem with handy-dandy mapping to their favorite language. Why on earth do we need WS- atomic transactions etc otherwise? There are plenty of more losely-coupled ways to model such required abstractions. Way too few people are thinking that the message is what's important and how it gets from A to B is an implementation detail. I just don't know what to do about that. Maybe we're the ones that are wrong?

I don't think we're the ones that are wrong. If SO is really just OO with angle brackets, then it's pointless. If you think that the only problem with the distributed object technologies is that packets on the wire and interface definitions didn't use angle brackets, you are very much mistaken. The problem was brittle systems that had to be deployed en masse. That is what Web services aim to fix.

That's why the clause in the WS-Addressing spec submitted to the W3C that I cited last week bothers me so much. Do we really want to introduce the notion of “an instance of a stateful service“? What is the difference between that and a distributed object? More importantly, what does it mean in the context of a server farm? If a service implementation requires pinning to a particular server to work, then it isn't going to work in a real enterprise environment.

None of this is to say that objects don't have a place in the implementation of a service-oriented system. Objects are a good way to implement a service. There are just two things we should NOT do:

  1. Believe that objects are actually integral to the Web services model for a distributed system. Objects are a very useful implementation technique, but nothing more. If a toolkit ends up using objects instances to represent stateful service instances, in which case we as an industry will have to figure out how to use that toolkit appropriately to build Web services the right way.
  2. Assume that a generic object/xml will achieve what we really want. In general, you want an internal object model that you use to implement your core logic. It is almost never the object model you get when you consume a schema. Given that, you have to write code to translate from the data coming off the wire to your own internal format. That's true whether the data coming off the wire is viewed as raw XML or an object model that a serializer built for you. (I should note that, despite my reputation, I'm actually not against object/xml or object/relational mapping tools, provided they're based on your problem domain. I take that position because, while I've seen many examples of custom mappers that worked within the scope of a given system, I've yet to see on that was both generic and actually worked well enough to use.)

Many of use remember the pain involved in figuring out how COM+ and J2EE should really be used (or not used), despite what vendors and/or pundits said. So take heart Jon; we can do it again if we have to.


Posted Nov 17 2004, 08:28 AM by tim-ewald

Comments

Erik Johnson wrote re: The role of objects in service-oriented systems
on 11-17-2004 9:11 AM
I don't know -- maybe there is a problem domain that stateful WS instances would be better at solving. I haven't found any.

At the risk of repeating some comments I made on Aaron's SOA Reuse post, remote objects are not failing solely for lack of wire interop. Data handling has evolved in federated systems to a point where remote objects stifle the solution.

So, I'm assuming people are working under the notion that service contracts will somehow describe the valid sequences of calls to stateful services to accomplish some meaningful task? Yikes. How does a service contract (not to be confused with contract-first, BTW) map to existing OO programming tools?

A web service operation should be (for lack of a better term) a unit of "business intent". Breaking an single intent into many calls makes designing apps as intermediaries virtually impossible. The service pipeline constituents (like workflow, pub-sub, governance, even security) have to keep figuring out what portion of what business intent is in play.

You can't make me do it! I'm not sure the WS-I can profile the ugly bits away this time. The chances of a standards bifurcation seem to keep growing.
Patrick Foley wrote re: The role of objects in service-oriented systems
on 11-17-2004 11:28 AM
Reading this post makes me wonder if one of the primary "smells" of an SOA is simply that it isn't chatty.

Technically, you can slip into a chatty service contract without stateful WS instances (by including some sort of state information or identifier in each request), but stateful WS instances would certainly encourage the practice.

It seems to me that SOA should strive to have operations at the granularity of "Place Order" and avoid operations at the level of "Create Order/Add Item/Delete Item/Complete Order" (which may be appropriate for other architectures). Maybe there is a problem domain where a chatty, stateful interface is appropriate for SOA, but I can't think of one either. If there is, then the implementer can still fudge it (we've been doing it with web pages for ages). Unless I'm missing something, I certainly wouldn't want to encourage it.
Tim wrote re: The role of objects in service-oriented systems
on 11-17-2004 3:46 PM
I think people are trying to coerce existing distributed technologies into the SOA mold and not worrying very much about whether the dilute what services are intended to be along the way.

The end result will be years of explaining to developers why some uses of SOAP/WSDL/etc. are not service-oriented and some are.

We went through the same thing with COM+ and J2EE: people had to learn that to make those technologies work, you had to create a different sort of object model.

If it were up to me, I'd rather vendors didn't try to unify everything under one banner. But if they insist on it, we shouldn't let it stop us from doing what we know from experience is right.
Dave Orchard's Blog wrote Web services vs Distributed objects, II
on 11-19-2004 11:56 AM
Tim's a little bothered by WS-Addressing introducing instances of stateful services into Web services, and correctly asks what the difference between stateful Web services and distributed objects are. IMO, the real answer is both not much and yet enough. Here...
SOAphisticated wrote More on Web services and distributed objects
on 11-22-2004 7:00 AM
TheChaseMan's Frenetic SoapBox wrote Revisiting: WS
on 11-22-2004 8:48 AM
TheChaseMan's Frenetic SoapBox wrote Revisiting: WS
on 11-22-2004 8:48 AM

Add a Comment

(required)  
(optional)
(required)  
Remember Me?