The magazine of the Melbourne PC User Group

Java Resources -
For the Bookshelf
Major Keary

Java has established itself as programming language of choice for a wide variety of applications; in particular it has been teamed up with XML to provide platform-independent tools for information sharing and data interchange. Another important feature of Java is its multilingual capacity that supports the 16-bit Unicode standard. 

Learning Java

Learning Java is one of some twenty titles in O'Reilly's Java series. It is not a beginner's introduction, but is aimed at "computer professionals, students, [and] technical people .. It's for everyone who has a need for hands-on experience with the Java language with an eye towards building real applications". A companion CD contains all the code examples used in the book and other software, including a compiler and class libraries.

There is an introduction to Java, describing concepts and providing a brief tutorial. The book then discusses development tools (compiler, interpreter, JAR, and embedding Java code in HTML). A group of five chapters contains a comprehensive discussion of the core language.

Two chapters focus on the Java Application Programming Interface (API). Topics include math utilities, dates, timers, security manager, streams, and data compression.

A section on Java networking covers general and advanced network applications, and programming for the Web. Java servlets are discussed in detail, and other topics include Remote Method Invocation (RMI) and sockets.
Java's graphics features receive substantial treatment in a five-chapter section that focuses on Swing, which is part of the Java Foundation Classes. This is by no means a full treatment of Swing, but has sufficient depth of detail for the purpose of showing what it does and how it works in the larger scheme of things.

JavaBeans is a technique for creating reusable software elements that can be linked together, or as plug-ins, in the construction of a larger application. A chapter describes the Bean architecture, rules, and how they are used. A thorough and well organised treatment of Java for those who have a reasonable familiarity with programming. The book is written in clear language that strikes a good balance: it does not overwhelm readers with technical terminology, but at the same time avoids talking down to its audience.

Niemeyer and Knudsen: Learning Java
ISBN 1-56592-718-4
Published by O'Reilly, 707 pp., 
RRP $75.00 incl. GST

Java and XML

Also in O'Reilly's Java series, Java and XML, is about XML for Java programmers. The author says, ". if you are a Java developer, you should use XML without question. For this reason if you are a Java programmer, want to be a Java programmer, manage Java programmers, or are responsible for or associated with a Java project, this book is for you".

There is an assumption that readers are versed in Java and want to know "how to put the two together to build rich web sites with dynamically generated content, . and to develop simple and effective solutions to . problems requiring portable data".

This is a particularly thorough coverage of the subject. The first seven chapters-almost half the book-explain the workings of XML. It is an introduction for Java programmers written using terminology familiar to them, as well as tagging "common pitfalls for new XML Java developers".

From there the book moves on to the convergence of XML and Java, beginning with the Java API for XML Parsing (JAXP), and JDOM (another API). Other chapters deal with:

  • Web Publishing Frameworks, which includes discussion of Wireless Markup Language (WML) and WAP, and eXtensible Server Pages (XSP).

  • XML-RPC, which compares XML's Remote Procedure Calls (RPC) with Java's Remote Method Invocation (RMI). RPC was not easy to use until XML provided it with the means of simple textual representation of data; the chapter discusses the benefits for Java programmers.

  • XML for Configurations discusses the use of XML to store configuration data and touches on EJB deployment descriptors as an example.

  • Creating XML with Java is about creating XML documents with Java.

  • Business to Business examines the use of XML for "communication across application and company lines" using case studies. Topics include XML versus EDI, Rich Site Summary (RSS), Push versus Pull, and the place of DTDs.

  • XML Schema. There is not room here for a meaningful explanation, but it is described in the introductory part of the book and more fully discussed in this chapter with parallels in Java.

Sample code is used liberally to illustrate the text; all the examples are available for download. There are also plenty of references to further online resources.

Brett McLaughlin: Java and XML
ISBN 0-596-99916-2
Published by O'Reilly, 479 pp. 
RRP $85.00 incl. GST

Java Network Programming

This is the second edition of this title. Java is credited with making the task of network programming much easier than in other languages. The author says, "That's because the Java core API includes well-designed interfaces to most network features".

The book sets out to demonstrate the use of Java's network class library for "many common networking tasks", which include:

  • Web browsing:
  • Parsing and rendering HTML;
  • Email with SMTP, POP, and IMAP;
  • Write multithreaded servers;
  • Install new protocol and content handlers into browsers;
  • Encryption and authentication;
  • Design GUI clients for network services;
  • Post data to CGI programs;
  • Look up hosts using DNS;
  • FTP;
  • Connect sockets for low-level network communications; and
  • Distribution of applications across multiple systems with RMI.

The first few chapters are an introduction to networking in general, and in particular the Internet, Internet protocols, and standards such as HTTP, HTML, and CGI.

There is an in-depth discussion of I/O and threading. Because Java handles input/output differently from most other languages a chapter is devoted to the way in which it handles input and output streams. A separate chapter deals with threads and the way in which the java.lang.Thread class is used.

Other chapters discuss:

  • Looking up Internet Addresses;
  • Retrieving Data with URLs;
  • HTML in Swing;
  • The Network Methods of java.applet.Applet;
  • Sockets for Clients;
  • Sockets for Servers;
  • Secure Sockets;
  • UDP Datagrams and Sockets;
  • Multicast Sockets;
  • The URLConnection Class;
  • Protocol Handlers;
  • Content Handlers;
  • Remote Method Invocation (RMI); and
  • The JavaMail API.

Sample source code is extensively used and is available for download from either of two nominated Web sites.

A thorough, in-depth description of how Java can be applied to networking. For anyone with a serious interest in how the Internet works there is much of interest, and which is written in language that does not assume a degree in computer science. It deserves a wider audience than professional programmers.

Elliotte Harold: Java Network Programming 2/e
ISBN 1-56592-870-9
Published by O'Reilly, 751 pp., 
RRP $89.95 incl. GST

JavaBeans

JavaBeans is defined as, "The platform-neutral standard for software components that run on the Java programming language" [Jonar Nader: Dictionary of Computing]. Unlike Java classes, JavaBeans contain additional data, which is explained fully in the introduction to Mark Watson's Creating JavaBeans-Components for Distributed Applications. The author says, "The JavaBeans component architecture was designed to support GUI layout editors and visual programming tools . [and are} . often . used simply as a high-level wrapper for Java class libraries and complete Java applications".

For anyone who wants to use JavaBeans Mark Watsons's Creating JavaBeans is a good tutorial and ongoing reference. It was published in 1998, but doesn't seem to have been overtaken by new developments. Examples, which have real-world application, are used to illustrate bean techniques; all the source code is included in the text and on a companion CD (which also comes with JavaSoft Java Development Kit version 1.2 and JavaBeans Development Kit version 1.0. The CD is set up for Windows and Linux users.

Mark Watson is a good technical communicator and does an excellent job of explaining how to write and package Java components.

Mark Watson: 
Creating JavaBeans-Components for Distributed Applications
ISBN 1-55860-476-6
Published by Morgan Kaufmann, 238 pp. + CD, 
RRP $73.46 incl. GST

Intelligent Agents with Java

Another title that has been in print for some time is Constructing Intelligent Agents with Java; it explains "the principles of AI program design using Java's object-oriented features and [presents] the essential AI algorithms used to develop agents that reason, model, and learn to adapt to the world around them".

The fascinating field of agent technology has not been the subject of recent publications, but is very much alive and well. This title provides a tutorial approach to the topic, laying out a number of real-world applications, complete with source code.

Even though designed for Java programmers, anyone learning Java is sure to pick up valuable insights. Java is well suited to AI applications and the authors discuss, in considerable detail, several working models. It is not just about Java, but also discusses a number of general AI issues.

Very well done, but not a text for novices. A companion CD contains all the example source code as well as the IBM Agent Building Environment Developer's Toolkit.

Joseph Bigus & Jennifer Bigus: 
Constructing Intelligent Agents with Java
ISBN 0-471-19135-3
Published by Wiley, 379 pp. + CD, 
RRP $65.60 incl. GST

Reprinted from the March 2001 issue of PC Update, the magazine of Melbourne PC User Group, Australia