Java is a programming language that is especially well suited for Internet and intranet applications. The Standard Edition of its runtime environment contains a variety of Application Programming Interfaces (APIs) for graphical user interfaces, handling of distributed objects, input/output, math routines, networking, security, and database access. This variety of APIs enables programmers to write powerful applications without having to purchase and learn lots of third-party libraries. The Enterprise Edition packages even more functionality: It contains essential APIs to build applications based on distributed components such as Enterprise JavaBeans (EJBs), servlets, Java Server Pages (JSP), and a Java Messaging Service (JMS). This chapter introduces you to Java and topics such as these; if you aren’t new to Java, you may want to go directly to Chapter 2.
Java and its environment were introduced in 1995 by Sun Microsystems, Inc. (www.sun.com and http://java.sun.com). Java was designed to meet the challenges of development in incompatible but networked environments.
Most modern programming languages already have some of the features present in Java, but none have all the features. A majority of developers, analysts, designers, administrators, and executives agree that Java is the long-awaited enabling computing technology. Much of the early discussion on the need for a Java-like language happened in Usenet newsgroups on the Internet. Now every major player has endorsed the technology and has delivered Java programs or even “Javatized” hardware. The reason is simple: Java’s features make it the best choice as an enterprise platform. Most of the features of Java and its environment are discussed in this section; however, Table 1-1 summarizes Java’s feature set.
API | Description |
---|---|
AWT | Abstract Window Toolkit |
JAAS | Java Authentication and Authorization Service |
JAI | Java Advanced Imaging API |
JAIN APIs | A set of APIs to develop integrated network services |
Java 2 | The object-oriented (OO) language for distributed computing |
Java 2D | 2D graphical routines |
Java 3D | 3D graphical routines |
JavaBeans | The Java component framework |
JavaCard | A set of APIs to program smartcards |
Java COMM | Serial communications (RS-232 and so on) |
JDMK | Java Dynamic Management Kit, which leverages the Simple Network Management Protocol (SNMP) |
JavaIDL | A Common Object Request Broker Architecture (CORBA) Internet Inter-Orb Protocol (IIOP) implementation |
JavaMail | Internet mail libraries |
JavaPhone | An interface for telephones |
JavaSpaces | A technology that enables dynamic communication and the sharing of Java objects |
JavaSpeech | A voice synthesis and recognition API |
JavaTV | An interface for television and set-top boxes |
JCE | Java Cryptography Extension |
JDBC | Java Database Connectivity |
JFC | Java Foundation Classes |
Jini | A framework to develop distributed services |
JMS | Java Messaging Service |
JMX | Java Management Extensions |
API | Description |
JNDI | Java Naming and Directory Interface |
JNI | Java Native Interface |
JSDT | Java Shared Data Toolkit, which is a collaboration and multimedia API |
JSP | Java Server Pages |
JTA | Java Transaction API |
JTAPI | Java Telephony call control API |
JTS | Java Transaction Service |
J2EE | Java 2 Enterprise Edition (including EJBs, JSPs, servlets, JMS) |
J2ME CLDC | Java 2 Micro Edition for Connected, Limited Device Configuration (CLDC) |
J2ME CVM | The virtual machine of Java 2 Micro Edition for devices supporting CLDC |
J2ME KVM | The virtual machine of Java 2 Micro Edition for devices such as Palm handhelds |
J2SE | Java 2 Standard Edition (core Java) |
EJB | Enterprise JavaBean |
RMI | Remote Method Invocation |
Servlet | Serving markup language content |
XML APIs | Java APIs for XML Pack (JAXP), Java APIs for XML Binding (JAXB), Java APIs for XML Messaging (JAXM), Java APIs for XML Remote Procedure Calls (JAX RPC), and Java APIs for XML Registries (JAXR) |
First and foremost, Java is definitely object-oriented. It is somewhat similar to C++, but its programming supplants functional and procedural styles. Java programmers manipulate only objects, data members, accessors, and mutators. Extra features such as automatic garbage collection (a garbage collector keeps track of the object instances and frees them when they are no longer used), object references replacing arithmetic address pointers, and native or nonnative multithreading add to Java’s simplicity and power.
Java is a truly object-oriented programming language. It fully supports encapsulation, polymorphism, inheritance, and dynamic bindings. The main benefit for the programmer is that his or her programming model will be close to the real-world objects, making the model easier to implement. Software reuse also benefits from this orientation, as is the case for many well-known C++ libraries.
These object-oriented qualities also apply to the numerous APIs, including JDBC. Although there is some impedance mismatch between OO programming and the world of relational databases and SQL (the language used to query those databases), the JDBC API helps you bridge the gap between both worlds. A good application design enables developers to define components to wrap and access databases in an elegant and reusable fashion. Furthermore, because JDBC doesn’t focus on a particular database vendor, the components are reusable across database products, too. With the combination of JDBC and the variety of APIs, Java is a real enterprise platform.