Java 1.2 Unleashed

Java 1.2 Unleashed
- 50 -
Java Commerce and JavaCard
- Java Electronic Commerce Framework
- The Java Commerce API
- The Java Commerce Toolkit
- The Java Card API
- Summary
Java Commerce and JavaCard
Not only is the Web changing the way that we share information, it is also changing the way that we do business. Since the earliest days of the Web, businesses arrived in droves to advertise their wares and set up electronic storefronts. With the omnipresence of business activity throughout the Web, approaches to implementing electronic commerce were eagerly sought. JavaSoft answers the call for a practical approach to electronic commerce with its Java Electronic Commerce Framework (JECF).
In this chapter, you'll be introduced to the JECF and learn about its key components. You'll learn about the JECF architecture and how it supports a multiplicity of electronic commerce protocols. You'll learn about the Commerce API and the services it provides. You'll also learn about the Java Commerce Toolkit and Java Wallet. Finally, you'll learn how the Java Card API is being developed to bring smart cards to electronic commerce. When you finish this chapter, you'll be familiar with the various ways in which Java is being used to support electronic commerce applications.
Java Electronic Commerce Framework
The JECF is a framework for developing products and applications that are used in electronic commerce. This framework was developed by JavaSoft to leverage Java's platform-independence to create secure and reliable software components for carrying out financial transactions.
NOTE: The Java Commerce home page is located at http://www.javasoft.com/products/commerce/.
The JECF consists of an architecture and a set of APIs for implementing electronic commerce solutions. Its architecture consists of the following four layers:
- The Java Environment Layer--This layer provides the foundation for the other
layers. It consists of the Java Virtual Machine and other elements of the Java Runtime
Environment. It may be implemented in the context of a browser, as part of the normal
JDK distribution, or in hardware such as a Java microprocessor.
- The Java Commerce Package Layer--This layer consists of those classes and interfaces
that provide the foundation for developing electronic commerce applications. These
classes consist of the Java Commerce API and supporting APIs, such as the Security
API, JDBC, the AWT, and others. The Java Commerce Package Layer is built on top of
the Java Environment Layer and supports the other layers of the JECF architecture.
- The Cassette Layer--The Cassette Layer consists of cassettes that implement specific electronic commerce transaction protocols. Cassettes store sensitive and valuable information related to electronic financial transactions, such as account numbers, digital certificates, and payment information. They make extensive use of the encryption capabilities supported by the Java API. Unique cassettes are developed for different payment protocols, such as Secure Electronic Transaction (SET), electronic money, and online banking. The Cassette Layer is built on top of the Java Commerce Package and Java Environment Layers.
NOTE: Java Commerce cassettes are logical objects, not physical objects.
- The Merchant Applet Layer--The Merchant Applet Layer consists of Java applets that are designed to provide an interface to financial transactions. Examples are shopping applets, banking applets, and financial investment applets. The Merchant Applet Layer is built on top of the other three layers of the JECF architecture.
Figure 50.1 provides an overview of the JECF architecture. The Java Environment and Java Commerce Layers provide the foundation for implementing electronic commerce. These layers consist of the classes and interfaces from which cassettes are built.
FIGURE 50.1. The JECF architecture.
The JECF provides a flexible framework for the development of electronic commerce
applications. Instead of limiting itself to a particular payment protocol, the JECF
allows standard and custom payment protocols to be implemented in terms of cassettes.
Cassettes are used as the building blocks for developing electronic commerce services. Some, but not all, of these services may be presented to consumers, businesses, and other organizations in the form of Java applets. Other cassettes may be embedded in standalone applications. Applets will provide attractive, easy-to-use interfaces to their customers and will use cassettes to carry out commerce transactions. For example, a shopping applet may use a number of alternative cassettes to support credit card payments, electronic checks, or electronic cash.
The Java Commerce API
The Java Commerce API provides the classes and interfaces for building commerce applications within the JECF. These APIs are implemented within the Java Commerce Package Layer of the JECF architecture and support a number of capabilities, including the following:
- The downloading, installation, operation, and management of cassettes
- The secure storage of sensitive and valuable information such as account numbers,
transaction details, and encryption keys
- A database interface
- Special GUI controls
At the time this chapter was written, the Java Commerce API was in the Alpha 0.8 release and consisted of the following packages:
- com.sun.commerce.example.post--Provides two classes that are used to post credit
card information and drive cassette installation.
- com.sun.commerce.gencc--Provides classes and an interface for the handling of
credit cards.
- javax.commerce.base--Provides base classes and interfaces that are used by other
packages of the Commerce API.
- javax.commerce.cassette--Provides classes and interfaces for the installation
and operation of cassettes.
- javax.commerce.database--Provides classes and interfaces that support database
access.
- javax.commerce.gui--Provides a number of classes that implement custom GUI controls.
- java.commerce.smartcards--Provides classes that support smartcards.
- java.commerce.log--Provides classes that support the logging of financial transactions.
- javax.commerce.util--Provides classes that encapsulate money.
These packages make use of other packages of the Java Commerce Package Layer, such as those of the Security API.
The Java Commerce Toolkit
The Java Commerce Toolkit is a set of tools for developing electronic commerce applications using the Java Commerce API. You can use it to quickly get a commerce application off the ground. It includes the Java Wallet, sample Java cassettes, and a sample shopping cart applet.
The cassettes implement common electronic commerce protocols. The shopping cart applet is used by customers to hold items to be purchased while browsing through an electronic store. The Java Wallet is covered in the next section.
Java Wallet
The Java Wallet provides GUI controls that are used to carry out financial transactions. These GUI controls are designed to provide a graphical representation of a traditional wallet. Figure 50.2 provides a screen capture of the Java Wallet interface.
Figure 50.2. The Java Wallet.
The purpose of the Java Wallet is to make users comfortable using electronic
commerce applications. The Java Wallet interfaces with cassettes that carry out electronic
commerce protocols. It's extensible and can support a number of different cassettes.
It was also designed with financial institutions in mind. It provides institutions
with the capability to tailor the wallet to display institution-specific information,
such as logos and address information, in a manner similar to credit cards, such
as Master Card and Visa.
The Java Wallet is not tied to any particular implementation. It is written in pure Java and will run on all platforms that support the Commerce API.
The Java Card API
The Java Card API is designed for creating specialized applications that run on smart cards. A smart card is the size, shape, and appearance of a normal credit card. The difference is that it has a small programmable computer embedded within it that contains memory and is capable of storing a limited amount of information. The availability and use of smart cards are expected to grow tremendously in the next few years.
The Java Card API was developed to program smart cards. It is a specialized API, in that it runs on a limited version of the JVM that is designed for the tight constraints of a smart card.
The Java Card API is compliant with ISO 7816-4. This means that it will run on any standard smart card. The Java Card API can be used to program smart cards for a variety of applications, such as identification and authentication, storage of medical information, and, of course, electronic commerce. The Java Card API is intended to provide a smart card implementation of the Java Wallet.
The Java Card API consists of a single java.iso7816 package that is based on the ISO 7816-4 standard (http://www.iso.ch). This package provides very low-level methods for controlling smart card operation.
Summary
In this chapter, you were introduced to the JECF and learned about its key components. You learned about the JECF architecture and how it uses cassettes to support a range of electronic commerce protocols. You learned about the Commerce API and about the services it provides. You also learned about the Java Commerce Toolkit and Java Wallet. Finally, you learned about how the Java Card API is being used to implement electronic commerce with smart cards. In the next chapter, you'll learn about the variety of execution platforms that support Java.
© Copyright 1998, Macmillan Publishing. All rights reserved.