Red Squirrel Reflections
Dave Hoover explores the psychology of software development


[Previous entry: "Systemic Change"] [Main Index] [Next entry: "Mind Your Metaphor (revisited)"]

Impressive Glue
Sunday, February 22, 2004

Back in early 2002 I played around with web services a bit. Since Perl was my strongest language at that point, I focused on the SOAP::Lite module. True to Perl culture, SOAP::Lite made simple things simple. I could write both clients and servers in about five lines of code. This ease-of-use helped me discover ways to use web services at work and at play.

After taking a new position later that year and immersing myself in Java, J2EE and ATG, my interest in web services faded.

This weekend, I am preparing myself for an interview on Monday with some folks who are up to their necks in web services. They use Glue and Fabric from WebMethods. So I've been playing with Glue today, and I am impressed...

I never would have predicted that a Java toolkit could be as concise as a Perl toolkit, but it's true. Here is a Glue web service:

import electric.registry.Registry;
import electric.server.http.HTTP;

public class SpikeService implements Apology {

public static void main( String[] args ) throws Exception {
HTTP.startup( "http://localhost:8053/glue" );
Registry.publish( "pavel", new SpikeService() );
}

public String sorryPavel() {
return "SOAP::Lite is good, but Glue is cool.";
}
}

public interface Apology {
public String sorryPavel();
}

Glue clients are equally simple:

import electric.registry.Registry;
import electric.registry.RegistryException;

public class Client {

public static void main( String[] args ) throws RegistryException {
String url = "http://localhost:8053/glue/pavel.wsdl";
Apology apology = ( Apology ) Registry.bind( url, Apology.class );
System.out.println( apology.sorryPavel() );
}
}

And in the spirit of cooperation, SOAP::Lite clients interoperate without a hitch:

#!/usr/bin/perl -w

use SOAP::Lite;

print SOAP::Lite
-> proxy( 'http://localhost:8053/glue/pavel' )
-> sorryPavel()
-> result;

I am encouraged by the simplicity (and price) of both of these toolkits, and pleasantly surprised by Glue.

Posted by Dave

Powered by Greymatter