One Size Doesn't Fit All

It's quite an accomplishment to run the same binary executable on such widely different architectures as MacOS, Windows, Linux and a quarter of a billion cell phones. There's more information about this coming up in Chapter 2, but for now, let's make an over-simplification and say that Java binary executables are interpreted on each platform.

The Java binary format doesn't contain machine code instructions for any one computer. It contains a slightly higher level, more general, set of instructions known as byte code. To run a Java program, you actually run an interpreter. The interpreter reads the binary file containing the byte code and translates it into the machine code for the system where you are executing the program. The full and more complete story is in Chapter 2, remember.

It's also not easy to run software on everything from a smart card to a supercomputer cluster. That encompasses a wide range of hardware capabilities—virtual memory, hard disk, processor speed, file space, GUI abilities, memory size, and so on. Sun has achieved Java support on virtually every computing device[1] by defining different “editions.” The smaller editions have a subset of the libraries in the bigger editions.

There are three editions of Java, and the smallest one is further sub-divided. For the sake of clarity, they should just have been called the small, medium and large editions, but the Java marketing folks at Sun gave them these names instead:

Micro Edition (the “small” platform)

The Micro Edition is a very low-footprint Java run-time environment, intended for embedding in consumer products like cell phones and other wireless devices, palmtops, or car navigation systems. You will develop your code using J2SE, and then deploy onto the various small devices. The Micro Edition is also known as Java 2 Micro Edition or “J2ME” for short.

The J2ME environment is further subdivided into “profiles.” There is a profile (Connected Limited Device Configuration, or CLDC) that defines the libraries available for PDA-type hardware. I have a handheld Sharp Zaurus PDA which runs the Linux operating system just like one of my desktop systems, so PDAs can be pretty capable these days. Another profile (the Mobile Information Device Platform, MIDP) is for wireless devices such as cell phones. Cell phones today are general purpose computers, with a few special peripherals. The smallest profile, which runs in just 128 Kbytes of memory, is intended for smart cards. It's called the Java Card API. The guy at Sun in charge of really dumb names (like J2SE SDK, CLDC and MIDP) must have been on vacation the week the API for Java cards got named “the Java Card API”. This profile is allowed to omit support for floating-point arithmetic when the hardware doesn't have it.

The J2ME environment is enjoying enormous success and has shipped in many millions of cell phones already. The year 2002 marked the point at which the number of handheld computing devices sold exceeded the number of PCs sold, so Java's success in this sector has real momentum. The Zelos Group (a company of technology analysts) predicts that Java will run on 450 million handsets by 2007, which is 75% of those shipping that year. As cell phones continue to evolve PDA features, and thus to push PDAs off the market, Java is available for both. Java completely dominates the cell phone programming market and has squeezed all rivals out of this space.

One programmer commented “by learning to program in Java, you free yourself from the limits of programming for just one OS or hardware product. It is an amazing feeling to see my apps running on my Palm Vx and my Motorola i95cl color Javaphone, and to know that they run just as well in any Nokia or Samsung or other java-enabled phone, on a RIM Blackberry, and on Windows CE.”

In May 2004, the top cable tv operators and suppliers (CableLabs, Charter, Cox, GoldPocket, Liberate, Motorola, Philips, Sun Microsystems, Time Warner Cable, and Vidiom Systems) jointly announced an initiative to develop a Java digital television API open standard. It is a CDLC profile called OnRamp, intended for legacy, resource-constrained cable television set-top boxes. It will be available to all set-top box vendors and digital tv developers, saving time and money for the entire industry.

Standard Edition (the “medium” platform)

Most people will work with this edition, as it is the edition with the libraries for desktop systems. The Standard Edition is also known as Java 2 Platform, Standard Edition or “J2SE” for short. Old-timers also use the abbreviation JDK (Java Development Kit) which was the term in use before Marketing and Legal rebadged it all. Using J2SE, you can write, deploy, and run Java programs for desktops and low-end servers.

This text focuses on J2SE, which is the best edition for those learning Java. Java's compatibility ensures that everything you learn for J2SE also applies to programming the very large and the very small platforms. You can be a cell phone programmer, and a cable tv set-top box programmer, too. NASA's Mars Rover mission, which enjoyed great success in 2004, made extensive use of J2SE to control the vehicle and visually interpret the images sent back to earth.

Sun intends to ship new J2SE releases on a regular 12-18 month cycle, with each update combining improvements in quality and performance as well as a small number of new features. That's the intent, but some releases (like JDK 1.5) have a lot of new features and came out on an attenuated timeline (translation: there was so much new stuff, the schedule slipped).

Enterprise Edition (the “large” platform)

This development product is intended for those building enterprise-class server-based applications. It contains everything in the standard edition, and additional libraries for enterprise directories, transaction management, and enterprise messaging.

The Enterprise Edition is also known as Java 2 Enterprise Edition or “J2EE” for short. This book describes several of the most popular libraries from the enterprise edition, including Java support for XML, for database access, and for servlets.


[1] I have a signet ring that runs Java programs! These rings were given out at the 1998 JavaOne conference. See www.ibutton.com.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.57.164