Distributed systems are an inherently tricky field. There are a million different problems that arise in distributed systems that don’t show up in concurrent systems on one CPU, which is why I find it to be so interesting. But this isn’t a rant about distributed systems. This is about a technology mentioned for a few pages in the Pickaxe book called SOAP, the Simple Object Access Protocol. It’s been a breeze to use so far (granted, my app isn’t that complicated yet), and much easier to get going than CORBA in Java (although I’m not sure if that’s a CORBA thing, a Java thing, or something else).
CORBA and SOAP both provide ways for one computer to access methods and objects that a program provides on a different computer. So I can write my application, decide I want to expose certain methods for anyone to call, and there we go!
This article also is not about a SOAP walkthrough, because everyone else has done it before and better than I could. For example, here’s a great intro to SOAP.
Something you do have to keep an eye on, though, are the data types you pass around. Here’s a point where Java and the statically typed languages are ahead, since by definition, they are checking the types ahead of time (e.g., at compile-time). In Ruby, I’m currently having issues passing hashes through SOAP. I can pass arrays through just fine, so converting them back and forth is a hack I have to live with at the moment. If you are doing Ruby and SOAP, you may find this data type reference useful, although it seems to think hashes are ok (they likely are doing something I’m not aware of).
So as usual, if you haven’t heard of SOAP, go check it out. Or at least go look at that intro to SOAP to see what all the “buzz” is about and get a better grip on one more buzzword in programming-land.