XML and Java for E-Business (2/4) - exploring XML | WebReference

XML and Java for E-Business (2/4) - exploring XML

XML and Java for E-Business

Java

The programming model of Java is object-oriented. Objects, instantiated from classes, are key to every Java application. Every class defines data that describes the properties of every object. A bank account might have an account number and a balance. Functions of a class specify the possible actions that can be performed on objects, for instance a money transfer from one account to another. Complex objects can be constructed through aggregation and inheritance. An object can contain others, and one class can inherit properties from another.

A class named, SavingsAccount, could inherit from a class Account and extend its behavior. Thus, whatever variables and functions class Account has, class SavingsAccount would also have through inheritance. For instance, if class Account has a function named withdraw() and a withdrawal from a savings account is attempted which would result in a negative balance, class savings account would throw a BalanceNegativeException and not be executed.

Java was initially developed for networked and embedded devices, trying to improve on some of the weaknesses of C++. In C++ memory needs to be allocated and freed by the application, potentially resulting in memory leaks (when you forget to free unused memory) or application crashes (when you try to access objects that are already freed). In Java, a garbage collector takes care of reclaiming unused memory, thereby eliminating the largest class of programming errors.

Development and porting of software to various operating systems often requires enormous effort because of the different system characteristics. Java sidesteps this problem through the introduction of platform-independent intermediate code, the so-called byte-code. This byte-code is interpreted by a Java Virtual Machine (JVM), which is available for all common platforms, and integrated in most Web browsers. This interpreted technique gives a performance penalty since the JVM needs to translate the byte code into machine-specific instructions. Various efforts have tried to remedy this, for instance Just-In-Time-Compilers (JITs) save the machine-instructions for the most often executed sections of a program for subsequent direct execution.

Since different uses for Java have developed, Sun has decided to create different editions of Java Software. The Standard Edition of Java (J2SE) describes the use of Java on the desktop, including libraries for building user interfaces, managing files and so on. The Enterprise Edition (J2EE) formulates a model for multi-tier-applications. Components of an application spread from front-ends such as Web browsers or Java clients to back-end systems such as databases, SAP R/3 or Lotus Notes. The middle tier are comprised of application servers, which offer new applications for business over the Internet or remote access for employees by opening up the backend services for the Web. The Enterprise Edition of Java defines services and programming interfaces for such multi-tier-applications.

On to the Java 2 Enterprise Edition.

http://www.internet.com

Produced by Michael Claßen
All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/xml/column27/2.html
Created: Jan 03, 2000
Revised: Jan 03, 2000