Monday, September 8, 2008

Contest to review technologies... hmm

I came across this piece of news a few days ago

Welcome, Students!
Review Sun products, and you may win cool prizes...Contest Details

Use MySQL database and GlassFish application server to develop a web application and write a review for...
A chance to win a grand prize of $500 in Visa debit card, and
Five chances to win a prize of $250 in Visa debit card

Simply:
1. Download MySQL 5.1 Community Edition and GlassFish v2 Update Release 2 (UR2).
2. Develop a cool web application using the combination.
3. Create a project of your application at java.net.
4. Write a review of these products and post it in your blog.
5. Submit your java.net project's URL and your review's URL.
6. Do it before October 22, 2008.


You can read the complete thing here. It sounds like a worthy project, though I guess projects that demonstrate and test the more elaborate features will be given more weightage. As they should be, I'd think, writing a review that tests basic JSP code would not really amount to much. The best part is that the competition only requires these two technologies as the qualifying criteria. Any other technology might be used in combination. This is a more open-ended approach than competitions that other companies organize. You can program in Java, PHP, Python or Ruby. With PHP in the mix, I'm sure the playing field would expand. And with Netbeans 6.5 beta offering PHP support, I'm sure Sun wouldn't some reviews. Oops, I veered off a little there... you do not HAVE to use Netbeans.

There are actually two compeitions, one for all students, and there is a seperate category for Sun Campus Ambassdors such as myself. Well, you don't have to tell me twice. But I'm still unclear of what technology to make the center-piece. I'm mid-way through learning jMaki (an AJAX framework) and the Metro WebServices Stack. But I'm also interested in SailFin and Semantic Web technologies. Well, I'll try a few of these out and then decide... Watch this space.

Friday, September 5, 2008

First encounter with Web Services on Java

In case you do not know what a web-service is, do head on down to the wikipedia page in order to get an idea of what they are. If I had to sum it up in one line I'd probably say it is "executing functions over the Internet, instead of fetching pages". Of course, that might be an over-simplification, but it if it gets you to read about it in detail on wikipedia, it serves my purpose :)

Some of you might be wondering what's so great about "executing functions over the Internet", that's what remote procedure calls are for. CORBA, RMI or DCOM do pretty much the same thing. Of course, if you read the complete page, you wouldn't ask that. It has advantages: it uses XML, (and in my opinion, when something which is already a vital asset begins to use XML, you'll have plenty of people supporting it in no time), it allows for loose coupling (SOA), and more...

The reason I put in the "and more..." is that Web Services are an industry-standard and has a lot of jargon. I discovered that this jargon and the complex standards can make this area almost intractable. I'd once tried my hand at a project that used Web Services in Python. The support at that time was iffy too, and the entire project was lost in an irretrievable maze of words I still had no idea about at the time I decided to scrap the entire thing.

About three years later, and I had to use Web Services for another project. There's a saying in hindi that'd summarize my views on doing that "doodh ka jala chaach bhi phoonk phoonk ke peeta hai" :D . It just means that I'd really want to test the waters before I went ahead. This time, I discovered, I had tools at hand to help me through the maze. In particular, Glassfish and Netbeans. I learned about it in a presentation given by Mr. Arun Gupta, and you can get some screencasts that should be just as good here or on his blog. Well, what a relief it was to use these facilities, as I never had to deal with the bare-bones of SOAP or WS-Security or WS-Transaction or WS-Policy. These were the very same words that'd I'd fumbled around with and tried to create right from the specifications on the W3C site all that time ago. Can't stress if enough: What a relief!

How do they do it? Well, Sun has created an entire stack of web services. It is called Metro, and starts with JAX-WS (Java API for XML WebServices) and then builds in all the other stuff I mentioned on top of it. You can have a look at the entire feature-matrix. And yes, inter-operability means that the code works with .net, whether client-side or server-side. It's called Web Services Interoperability Technologies (WSIT). If you want to know more, check out the project's site here

Now for the tools. Glassfish includes the reference implementations for all of this stuff, and if thus reliable. Not to mention, it Metro comes bundled with Glassfish, so minimal download and installation hassles. Next comes Netbeans, which allows you to just drag-and-drop your web-services. Client-side, server-side, it's all taken care of. Of course, I had Glassfish with Netbeans, and minimal hassles.

All in all, I can go right to developing using these tools after reading around, and watching the screencasts, in the maximum of a day. Pretty nifty, I you ask me.