Danny Coward's Sun Weblog

Main | Next page of month (Feb 2006) »

20060227 Monday February 27, 2006

Java SE 6: Mustang and WS-TMI
Filed under: javase6

Did you know that Java SE 6, Mustang, features a subset of the Java EE Web Services stack ?

I've been tinkering with it, check it: Its JAX-WS (JSR 224) with a helping of JAXB (JSR 222) for its data binding, a good dollop of WS Metadata Annotations (JSR 181), with a sprinkling of a few of its own. Of course you've already teased a coulis of XML strained with WSDL in a JAX-RPC boullion with sun-dried MTOM/XOP and hand-crushed swaRef...

Yawn, W H A T E V E R . Too much information. Way.

Let's try it this way around....you have a neat little program, see ? It does something cute like adding a couple of numbers, which is self-evidently your market-dominating online service in thin disguise:

public class NumberAdderUpperer {

   public int addNumbers(int number1, int number2) {
        return number1 + number2;
    }
}


And naturally, you know you want to tell all your friends to use it, so in Mustang, they made it so you can do this:

import javax.jws.WebService;

@WebService
public class NumberAdderUpperer {

   public int addEmUp(int number1, int number2) {
        return number1 + number2;
    }

}


OK, so now you'd hit deploy in your IDE of course and stick it on the corporate app server, tell the world, and be done. But for the slightly more cautious amongst you, let's you and I do it with nothing more than the Mustang SDK, which has its own mini-Http server just for things like this:-

      import javax.xml.ws.Endpoint;
            ... 
        Endpoint.publish("http://localhost:8080/ws-tmi/adderupperer", new NumberAdderUpperer ());


Oops ! And now your new number adding service is published at:  "http://<hostname>:8080/ws-tmi/adderupperer".

Could it BE any easier ? (actually, maybe you think it could - let me know....)

And I did mention that adding numbers is an incognito book ordering or drug prescription authorisation service, and your soi-disant friends unmasked: they're your customers or patients, right ?

Ya, two imports and an annotation: that's the kind of simplicity I can go for.



Posted by dannycoward ( Feb 27 2006, 04:56:44 PM PST ) Permalink Comments [10]

20060222 Wednesday February 22, 2006

Postcards from the J2SE Team
Filed under:
Very glad to be back in the Bay Area after a 10 day trip touring some of our J2SE people in Europe. Yet I must say that I need regular doses of European attitudes to keep a view broader than one of the world through just an american lens.




Yes, in Grenoble, you can work in high/bio-tech, and have 25+ paid vacation days with this on your doorstep.
















And as was evident from the density of cranes on the skyline, two seen here towering high somewhere over the Book of Kells in Trinity College, Dublin's continued economic boom proves the lackluster performances of the economies of it its continental neighbors over the last 10 years is not universal in Europe.








[I also stayed one night in Paris. At the Hilton. I did chuckle more than once to myself, even though the joke is long dead.]

Posted by dannycoward ( Feb 22 2006, 10:48:35 PM PST ) Permalink

20060215 Wednesday February 15, 2006

Mustang Opens Kimono on javac
Filed under: javase6

In a previous post about my *heart* of NetBeans, I talked about javac taking a nap due to the helpful code checking syntax and reference errors, and associated squiggles that NetBeans was doing for me.

Sleep no more ! javac is about to get busier than ever.

In fact of course, as was pointed out to me by one of our experts (thankyou Jonathan), javac is behind all those squiggly lines qand helpful messages. No wonder the message text is invariably exactly consistent with what one would see in a compilation. Isn't it nice when things are simple and consistent like that ? Its the sunshine and birdsong of good user experience. How reassuring software is when it does what you expect it do to do. And how clever of those Netbeans folks to adapt a version of javac to do it.

No good idea goes unpunished of course: the Mustang version of J2SE, the beta version of which you can get as of this morning, gives you a similar degree of control over (anybody's implementation of) javac, with the addition of the Compiler APIs. Want to do your own code syntax checking ? Want to dynamically compile a dynamically written class, load and instantiate it in the same runtime ? Pretty cool, huh ? By the way, everyone say hello to the JSP and PHP container developers; I imagine they are pleased its finally here in the platform.

It makes even a grumpy ex-Smalltalker like me smile. Maybe I'll be able to write all my code just ahead of the debug breakpoint soon...

javac, sleep no more !

Posted by dannycoward ( Feb 15 2006, 10:26:03 AM PST ) Permalink

20060214 Tuesday February 14, 2006

Where's Danny ?
Filed under: postcards
Dear Readers - I do have a number of things I want to tell you about, but for now I am on the road to visit some of our J2SE folks in Europe.

So coverage may be a little spotty. More tomorrow, though, as its an important day for J2SE.

I had forgotten that traveller's feeling of leaving one's home in one part of the world and dropping in as if a disembodied spectator on the lives of people on a different continent, without an interlude of sleep to normalise perception. Maybe people here in Paris look at me and see 'disembodied'. Nine shave-free timezones later I wouldn't blame them.

As a caution to the webloggers amongst you, am reading Diary of a Nobody. Paper version. Sorry lady-on-plane for laughing so much.

Posted by dannycoward ( Feb 14 2006, 03:31:12 PM PST ) Permalink

20060208 Wednesday February 08, 2006

And for the rest of you...
Filed under:
In my first post, I made hopeful references to 'those who know me'. I realise such people as are members of that group, which I hope perhaps, Dear Reader, you are in the process of joining, are but as a handful of energetic quarks in an expanding universe of mysterious matter. So for the rest of you, even the search bots and web crawlers (I *heart* you too), should you be interested, here's a bit more about me.

Penned flatteringly by Susan Mitchell, who coincidentally wrote an article covering what Eduardo and I had to say about JSPs and Servlets back in 2000 at JavaOne, in what she described to me as her first 'live story'. (That was of course in the days when I was prey to my own nicotine addiction, and could be seen emitting billowing clouds of poisoned smoke before any remotely stressful occasion to pep me up. And afterwards. To, er, relax me.)

Posted by dannycoward ( Feb 08 2006, 03:26:43 PM PST ) Permalink