Java is really the only language in widespread use that can easily be used to build systems that meet the requirements I just listed for an enterprise system. Java is a standards-based language that is platform-independent. It has support for accessibility and internationalization and localization, including a Unicode basic character type, built into the language. Finally, Java is an object-oriented language with database access and distributed computing at its core.
One important test of whether a component of your enterprise system is proprietary is whether or not another vendor could, in principal, provide a black-box implementation of that component. The Java Virtual Machine (JVM), for example, is an open specification for which others can—and some do—write independent implementations. Java’s suitability for this requirement, however, goes beyond the fact that it is a standardized language that is platform-independent. It also provides a host of APIs that you are guaranteed to find on any JVM for accessing hardware and software resources traditionally blocked by expensive, proprietary interfaces. For its original release, the Java specification prescribed what Sun termed the Java Core API—the basic objects required for a minimally viable language. The Java platform specification has since grown to encompass many other APIs. The following is an abridged list of some of the Java APIs:
- JavaBeans™
In response to the Microsoft ActiveX threat, JavaSoft developed JavaBeans, a platform-neutral specification for creating software components. Part of the JavaBeans specification actually involves interfacing with ActiveX components.
- Java Commerce
Java Commerce is an Internet-based API for providing secure economic transactions across an insecure network. This API includes Java Wallet, which is a framework for client-side credit card, debit card, and electronic cash transactions.
- Java Core
Java Core consists of libraries that shipped with the JDK 1.0 release. It includes the
java.applet
,java.awt
,java.io
,java.lang
,java.net
, andjava.util
packages and provides the core level of functionality needed in order to build simple applets and applications in Java.- Java Embedded
The Java Embedded API enables devices such as cellular phones and toasters, which may not be capable of supporting the full range of Java Core functionality, to offer a subset of Java Core.
- Java Enterprise
Java Enterprise actually consists of three separate libraries that provide access to an organization’s resources and applications. The Java DataBase Connectivity API, or JDBC, provides database connectivity. Using JDBC, an application can perform database access independent of the actual database engine being used for data storage. The same application can be written once, compiled once, and run against any database engine with a JDBC driver.
The Interface Definition Language (IDL) enables Java applications to provide a language-neutral interface between Java objects and objects located across the network. It follows the Object Management Group (OMG) IDL specification.
Remote Method Invocation (RMI), is a Java-specific API that lets objects call methods in objects located across the network. Unlike IDL, RMI is a Java-only solution. Instead of writing complex communication protocols using sockets, an application can communicate with remote objects through simple Java method calls.
- Java Management
Java Management lets an application perform network administration.
- Java Media
Java Media creates a single API that enables developers to write rich multimedia applications interfacing with a variety of multimedia hardware devices. The Media Frameworks provides clocks for synchronizing audio, video, and MIDI. The 2D and 3D libraries provide enhanced imaging classes. The Animation API enables applications to perform transformations on 2D images. Telephony provides an application with a single API for accessing a range of telephone devices.
- Java Security
The Java Security API provides developers with a simple API for enhancing applet or application security, including the ability to add cryptography, encryption, and authentication.
- Java Server
Java Server is Java’s answer to CGI. This API allows developers to interface with and enhance Internet servers using servlets , executable programs that users upload to run on networks or servers.
As Sun develops specific APIs, it enlists the cooperation of major industry players in the area of the API in question. In developing the database access API (the subject of this book), Sun worked with a team of database leaders and listened to extensive public input. Some of the companies that have been actively involved with database API development are shown in the following list. These companies are not simply paying lip service to the technology. They have committed time and money to make sure the level of support is intense enough to lend substance to the hype.
Java is the first major language with internationalization and localization built into it. The most fundamental evidence of this support lies in the Java character datatype (and the String class based on it). Java characters are two bytes, and Java strings are Unicode, not ASCII. This means that you can store in a single Java string a paragraph containing sentences in every language known without any programming tricks.
Internationalization and localization involve a lot more than character-set encoding issues, and Java recognizes that. Java provides client applications direct access to the locale information for the clients on which it runs. Java applications can automatically use this locale information to provide the proper display of locale-sensitive strings such as date, currency, and numeric strings. A Java developer does not have to know any of the issues surrounding localization for a particular locale—Java does the formatting automatically.
Accessibility is even simpler for developers. In fact, there is absolutely nothing a Java developer needs to do to make an application accessible other than follow good user-interface programming practices. Java uses the clues a well-developed user interface provides to make that user interface accessible.
There is a lot more to Java support for internationalization and localization. A full discussion of these issues is well beyond the scope of this book.
One of Java’s most powerful features is built-in support for distributed computing. Java RMI, one of the Java Enterprise APIs, provides this support. By taking advantage of Java RMI, business objects created in Java can be exported and shared by multiple user interfaces. The same business object that represents a toaster you have in stock can be immediately referenced by an employee in Singapore, a distributor in Houston, and a customer shopping on the Web.
Note
A business object is not necessarily a business concept. It is simply a term used to represent any concept that is part of a nontechnical problem domain. For our manufacturing example, product would most likely be a business object. The concept, however, extends beyond business. In an online fantasy game like a mud, Sword, Monster, Player, and Bag may all be business objects. Business objects are basically distinguished from other kinds of objects in that they are shared objects and represent a concept within the problem domain.
Get Database Programming with JDBC & Java, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.