The Strange Pleasures of J2ME.

| No Comments

Working in J2ME means do more with less, and has really illuminated specifications in a way I wasn't capable of doing before. The difficulties in the XML spec become much clearer, SVG Tiny starts to look huge, and things which might have looked reasonable in the ever-faster ever-more-bloated environment of PCs become plainly stupid. While I miss a few things (like Java 2 Collections), for the most part, it's a privilege to work in a leaner environment for a while. I doubt this will sweep the computing world, but maybe it should. [Simon St. Laurent - "The strange pleasures of J2ME"]

I know exactly how Simon feels. My research into, and at times outright yearning for, a simple and streamlined desktop apps is a direct result of my work in mobile computing and more particularly J2ME. Working with J2ME really makes you think about what really is necessary in providing the solution as opposed to whiz-bang features and other forms of programmatic kung fu. What's more amazing to me is how incredibly small and lightweight functional applications can be relative to what we have on the desktop. Its made me come to the realization that as programmers we have, perhaps subconsciously, become far too reliant on the every increasing resources the Intel, Microsoft and Dell tell us we need.

This is not to say that Photoshop or a full-featured web browser can be written in a 35k MIDlet. For some applications this approach is not really feasible. Nonetheless most application code are interfaces with some data handling logic. Coupled with Web services to a robust backend, these applications should be quite small and very quick on their "desktop mainframes" most users have on their desktop. If it weren't for the 20 MB download required, I would say the .NET Framework in some ways demonstrates. The MIDP KVM and core libraries are measured in KBs not MBs.

MIDP is a bit too spartan and extreme for use on the desktop. With the basic and limited GUI provided by MIDP, you will not win any design contests. MIDP is just one profile (and the smallest for that matter) in the J2ME world. In the J2ME connected device configuration or CDC (MIDP is in the Connect Device Limited Configuration or CDLC) there are profiles such as the Personal Basis profile, that have richer, yet highly streamlined, APIs that might be more appropriate for desktop application. (J2SE may be fine for developing JBuilder, but its just too fat and overkill for its own good. Don't even get me started on Applets either.)

Simon links to his Tiny API for Markup (TAM) that comes in a 17 KB Java archive file. The kXML 2 parser however is substantially smaller. (~6 KB I believe) kXML a simple pull parser rather then Simon's SAX2-like parser. The next version of MIDP that is in the works, MIDP 2.0, will most likely include an XML parser that I believe may be based on kXML. Additionally the JCP has released or are developing several extension APIs that can be added on an as needed basis -- all in the tens of KB size range.

The uses of XML over expensive slow and unreliable networks is an issue that has not received enough attention in my mind particularly in the area of mobile computing and Web services, a topic I have voiced my reservations about. Jeff Bone has recently been writing about "XML sucking" and in his recent post points to XTalk a "semi-parsed, pseudo-binary representation of an XML" from IBM Labs. WAP employed a similar tact with its WAP Binary XML (WBXML) specification. While attending the Wireless Enterprise Seminar in Atlanta this May, I saw Adam Bosworth present a wireless application framework powered by J2ME using a "binary DOM representation" to communicate to its ultra thin client app. JXTA uses a binary format for its J2ME client, but I'm unsure if it is a tokenized binary representation of XML like the others.

While XML purist probably wince at this ideas, they seem like a reasonable comprise given the constraints of the mobile computing and making XML viable while remaining true to its core principles. I only hope that we settle on one standard method for this encoding.

Leave a comment

About this Entry

This page contains a single entry by Timothy Appnel published on August 22, 2002 5:47 PM.

A J2ME Tip on Binary Compatibility. was the previous entry in this blog.

EJB 2.1 = Web Services. is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.2rc2-en