internet.com

Library

An Overview of the Java Market

by Don Larson

It's hot. It's happening. So should you be using it? Explore Java's special status in this overview of Java and the Java market.

Despite its short time in the world, Java has been adopted faster than any other programming language in the history of computing. Riding the coat tails of a "new media" explosion, the upstart language has become synonymous with the Internet.

However, Java is quickly outgrowing the confinements of its early bell-and-whistle days, finding itself used more and more as a robust, all-purpose platform for building full- featured applications in an increasing number of new niches. Last year, this versatility and scaleability led over 200,000 programmers and a third of all companies with more than 5000 employees to begin using Java in their application development, according to Sun Microsystems.

With the advent of an even more robust Java in the latest 1.1 release, and industry support from companies like Netscape, Cisco and IBM, who pooled $100 million to form a venture-capital resource called the Java Fund, the numbers associated with Java in 1997 will be even more astounding.

Java's rise has been meteoric, indeed. And, as with any new star, its every move has been surrounded with hoopla. For the past year or so, you've been hammered with hype and pummeled with puns. What you may have missed amid the fanfare, however, are the basics of what Java is all about: what it is, and what it can do for you.

To that end, Web Developer® presents a detailed look at Java designed to go beyond the buzzwords and get down to what really separates Java from the pack. In the process, we'll also illustrate the many and various applications that developers in the Java market are finding for this promising young language.

WHAT IS JAVA?
An "official" definition of the language usually goes something like this: Java is a simple, object-oriented, multithreaded, portable, platform-independent, secure programming environment used to create applications and smaller programs known as applets.

A useful definition, if you enjoy Java jargon. But what do these designations mean in real-world terms, and how do they differentiate Java from its predecessors? Let's take a look:

Simple: Java is basically a "stripped-down" version of C++, in that many of the rarely-used and confusing features of the latter have been removed. Java also does its own garbage collection and eliminates pointers, thereby easing the task of memory management and debugging (We'll take a more detailed look at how Java compares to C++ and other popular languages later in the article). There are two primary benefits to this simplification: it makes migration to Java easy for the majority of programmers, and it creates a compact language that transmits well over networks.

Object-Oriented: In Java, everything is an object, or at least attached to an object-even global variables. Among other benefits, this makes it easier to reuse objects with other objects. Also, instead of multiple inheritance (subclassing), as in other O-O languages like C++, Java supports inheritance through interfaces. Interfaces are sets of method definitions that basically describe classes and how they interact with the world. Using interfaces, a Java class can, at least in theory, borrow the methods of any other class. Therefore, developers don't have to worry about inheritance at design time, taking a lot of the planning and pain out of creating interfaces.

Multithreaded: Applications written in Java are capable of handling many operations simultaneously. While it's possible to do this manually in other languages, Java's multithreading capabilities are integrated directly into the language as primitives. By providing better performance and responsiveness, multithreading makes up for some of the performance Java sacrifices as an interpreted language.

Portable: Java is able to run on almost any computer regardless of its platform or operating system. This makes it perfect for heterogeneous networks like the Internet and corporate intranets. Platform-independent: Applications written in compiled languages like C++ must be ported to every platform and OS you want them to run on. In contrast, Java is an interpreted language. Rather than native machine code, the Java compiler first translates applets into bytecodes: a high-level, machine-independent code only comprehensible to the Java interpreter, or virtual machine. This bytecode is handed at runtime to the Java Virtual Machine (VM), which then translates these instructions into native machine code on the fly.

Therefore, instead of every application, only the VM must be ported to each platform. A number of vendors have also introduced "just-in-time" compilers that allow Java apps to be custom compiled directly into the machine language of a particular platform. Bypassing the VM, JIT compilers enable you to trade portability for greatly enhanced performance.

Secure: Any time you are downloading executable code on a network, security is an issue. Because Java was developed from the ground up to be used in a network environment, however, it has a number of built-in security features.

Foremost among these is the Java VM, which acts as a mediator between Java bytecode and a CPU. It does this by creating separate and confined memory for applets to run in, then screening each instruction before it is passed to the CPU. Specifically, applets must run in a protected space that prohibits access to the local disk -- the Java "sandbox." Applets loaded over the Internet are not, by themselves, able to read or write files, start other programs, load libraries, or define native method calls.

The 1.1 release of Java does provide for a finer level of control over security, however, namely in the form of digitally signed classes. This will make it possible to open up objects, like a user's hard drive, to an authenticated applet.

ADDING IT UP
What all these features add up to is a programming language ideally suited to developing programs for delivery via the Internet and corporate intranets. And because Java applets can run within Java-enabled browsers already in wide distribution, the Java environment is automatically equipped with a thin client that is as close as you can get to zero administration. In addition, applets reside server-side and are downloaded to the client upon request, so Java applications are easy to extend and revise as needed.

WHAT'S IT GOOD FOR?
Even though Java sounds great on paper, many developers still question its real-world utility. This is perhaps the most important question that the Java development community will have to answer in the coming year: "What can you really do with Java?" This is not to say, however, that the Java market doesn't already bear the fruits of Java's network-savvy characteristics and functionality. In fact, given the short time the language has been available as a development platform, the variety and robustness of Java-based applications currently on the market are strong indications of Java's usefulness -- and of things to come. For a better perspective on the range of applications Java is capable of, including how these apps demonstrate many of the unique features discussed above, here's a quick sample of Java in its many settings:

Web sites: Although Java may be outgrowing its roots, it hasn't forgotten them. Java animations, special effects and interactive applications are still some of the best ways to make a static Web site come to life. For example, applets like "nervous" text, LED displays and scrolling marquees are now ubiquitous on the Web. These animations have a distinct advantage over other methods of imparting motion, such as animated GIFs, in that applets can be interactive.

Take, for instance, c|net's "news ticker" applet, in which visitors can click on a scrolling list of headlines and be taken directly to the appropriate page. Interactive, animated imagemaps, as the Penumbra Software site demonstrates, also add a whole new level of cool, with elements like buttons that change color, activate pop-up menus and even play audio as a mouse moves over them.

While this type of content can be created in other ways, such as Macromedia's Shockwave, applets take advantage of Java's platform-independence and widespread browser support, so they don't require users to download more plug-ins or otherwise upgrade their software.

Java is capable of producing full-featured interactive applications for a Web site. Java-based programs like EarthWeb Chat and Eastland Data Systems' Internet Shopping Cart are quickly replacing applications that previously required separate client software.

Java has also been used in the areas of indexing, searching and data mining, as products like Innotech's NetResults and Cadis Inc.'s Krakatoa attest. Along with features like cross-platform, multithreading and even drag-and-drop interfaces, these applications also take advantage of Java's distributed computing capabilities to download executable content to the client.

Flattening the architecture in this way not only removes much of the server strain that results from the older, CGI-based models (which require a separate server connection to update pages), but also grants the user a higher degree of interactivity and responsiveness in their experience. Using the NetResults search engine, for example, users are not simply given a page of static hyperlinks, but an applet that displays a visual representation of the requested data that can be interactively refined and otherwise manipulated, without additional connections to the server.

Corporate intranets: In addition to the sample applications just listed, enterprise developers and vendors have found special niches for the Java platform. On a more abstract level, Java's robust and dynamic characteristics make it perfect for prototyping, not unlike other interpreted languages like Tcl. Java's lack of pointers enables programmers to develop programs efficiently, without the constant interruption of memory corruption. And because Java is a strongly-typed language, method invocation errors are reported at compile time, rather than run time.

More tangible uses, like standard business applications, are also being developed in Java. For instance, Corel recently introduced Office for Java, a suite of business applications that includes Java versions of the company's popular word processing, spreadsheet and presentation software. In many ways, the suite represents the desktop of the future. The "fat" client of old is replaced by a network-centric approach in which the applications reside on the server and are seamlessly downloaded to the client as needed. Furthermore, the suite is completely compliant with JavaSoft's JavaBeans component model, which means the applications will be easily extensible via third-party modules.

It is in the area of Web-to-database connectivity, however, that Java's most significant enterprise utility lies. JDBC, Java's database interface, provides a platform on which programmers can bypass the traditional client-server architecture by creating single front- ends that deliver uniform access to almost any brand of SQL database via any Java-enabled browser on any platform. Many vendors are also using Java to develop end-to-end, server- based database solutions written completely in Java, as demonstrated by products like Infospace's SpaceSQL. Putting Java in the database equation produces a number of benefits for administrators and end-users alike, including enhanced performance from multithreaded servers, automatic installation and platform-independence for clients, and interactive query and drill-down capabilities for consumers.

Stand-alone applications: Finally, the fact that many developers are releasing full-featured, stand-alone applications that are 100% Java attests to the scaleability of the platform. One of the best-known examples in this category is JavaSoft's own Web client, the HotJava browser. Initially released as a "proof of concept" product for Java, HotJava lives up to its calling, demonstrating Java's built-in networking functionality as well as its extensibility and versatility. The browser interface, for instance, is fully customizable, so that both end-users and administrators can configure it to suit tasks ranging from a desktop browser or intranet client to an interface for an "information appliance" like a kiosk.

As the network computer, or NC, and Java's operating system, JavaOS, begin to show up on more desktops, so too will more Java-based applications.

JavaSoft's HotJava Views is a forerunner to these types of network-based computing applications. Views 1.0, the first user environment for the JavaOS, contains an e-mail client, calendaring program, name directory access and a HotJava browser. The 2.0 release will be entirely cross-platform, running on any server with a Java VM. Among its other firsts, Views sports a true zero-administration client, greatly reducing the resource drain commonly associated with traditional client-server applications.

Of course, vendors other than JavaSoft are building full-scale applications on top of Java. Perhaps one of the best examples is Marimba Inc., a company that has taken Java into the push technology market. Castanet, the company's channel software, takes advantage of Java's distributed, scaleable and platform-independent capabilities to automatically distribute and maintain software and content on a subscriber's desktop. The product enables content providers, MIS departments and even software vendors to deliver applications ranging from entertainment Web sites to full-featured business and productivity software over private networks and the Internet.

IS IT WORTH THE SWITCH?
Once you've answered the question of Java's worthiness as a development platform, a second question rears its head: "Why choose Java over the platform(s) you're currently using and already familiar with?" While many of the features described above provide at least a partial answer to this query, a side-by-side comparison of Java and its peers will help to clarify it more.

Java vs. JavaScript: Unlike the name suggests, JavaScript is not a by-product of Java. In fact, Netscape's higher-level, user-friendly scripting language was developed separately from Java (and was codenamed, interestingly enough, "Mocha"). JavaScript is designed to fill the gap between CGI and Java, complementing both in the process. Unlike Java, which is compiled into bytecode on the server, JavaScript is a scripting language that is fully interpreted by the client. JavaScript embeds built-in, extensible objects directly into HTML, but contains no classes or inheritance. This simplification is both a pro and a con for JavaScript: while it limits the language's functionality, it also enables you to build very lightweight, cross-platform programs that help reduce strain on the server. Ultimately, JavaScript was designed to provide an easy way for Web developers to create interactive Web pages, not create stand-alone applications like Java applets.

Java vs. ActiveX: Comparing these arch-rivals is a lot like the proverbial apples and oranges debate, in that Java is a programming language and ActiveX is a component framework. In this way, ActiveX is more akin to the JavaBeans component model than Java itself. Basically, ActiveX is a system for managing code written in other languages, namely Visual Basic, and for distributing and interchanging this code on the fly.

Two of the biggest concerns with ActiveX center around its portability and security. Because it is based on Microsoft's OLE and OCX components, ActiveX is really best suited for applications in a primarily Windows-based environment. And because the ActiveX security model allows binary code to be executed on the host machine's hard drive, rather than in a protected space like the Java VM, malicious attacks and viruses are a real concern. Ultimately, Microsoft plans to address these areas, lending ActiveX more platform-independence and providing digitally signed code. As many developers will attest, however, "vaporware" is a tough platform to build on, and Java's second revision is available today.

Java vs. C++: Many of the similarities and differences between Java and its precursor, C++, have already been mentioned. C++ is a low-level, fully-compiled language primarily designed as a platform for large-scale applications in which speed is a major concern. While C++ is many times faster than interpreted languages like Java, it sacrifices portability in the process. And Java's speed deficiencies are being addressed by a faster 1.1 VM and the JIT compilers currently available. Moreover, considering the widespread adoption of Java, chances are it won't be an interpreted language much longer, and thus won't be forced to rely on these stop-gap measures for better performance. In addition, C++ programmers must implement memory allocation and garbage clean-up manually, which often leads to many hard-to-find bugs, general protection faults and system crashes.

The biggest advantage Java holds over C++, however, is its tight integration with the Internet. This allows Java to adapt and evolve alongside the Internet more readily than other languages, making it a prime platform as applications move from traditional client-server models to Internet- and intranet-based paradigms.

Java vs. Perl: Perl lies somewhere in between low-level languages like C++ and high-level scripting languages like JavaScript and Tcl. Perl has evolved into a language that has much in common with Java: it's object-oriented, secure, robust, dynamic, and architecture- neutral. Perl contains powerful functions for manipulating strings of text. Therefore, it is very good at finding, extracting, and recombining data with remarkable concision. This makes it perfectly matched to the needs of CGI scripting, where Perl is most commonly used today.

However, server-based CGI programs, as mentioned previously, place additional connection and processing burdens on the server. As the number of users increases, the performance of the server typically declines, meaning Perl and other common CGI languages don't scale well for larger applications. Java, on the other hand, shifts most of the processing duties to the client in the form of downloadable, executable content.

JUST DO IT?
In the end, whether you decide to "just do it in Java" will depend on the customer base your application will serve and the criteria it must meet. If, by chance, you have to deliver a large-scale, high-performance application that will run in a Windows-only environment, then platforms like C++ and ActiveX are probably still your best option. If, however, you are commonly asked to produce interactive graphics, front-ends or full-scale applications that will run securely on the largest majority of clients connected to the Internet or operating on the heterogeneous networks of a real-world intranet, then it's time to add Java to your application development arsenal.


Don Larson is Associate Editor of Web Developer®.

Web Developer® Site Feedback
Web Developer®
Copyright © 2000 internet.com Corporation. All rights reserved.