Oracle8i Enterprise JavaBeans and CORBA Developer's Guide
Release 2 (8.1.6)

A81356-01

Library

Product

Contents

Index

Prev Next

1
Overview

This chapter gives you a general picture of distributed object development in the Oracle8i JServer. As with the more specific chapters that follow, this overview focuses on the aspects of Enterprise JavaBeans and CORBA development that are particular to JServer, giving a brief general description of these standard development models.

This chapter covers the following topics:

Prerequisite Reading

Before consulting this Guide, you should read the Oracle8i Java Developer's Guide, which gives you the technical background information necessary to understand Java in the database server. As well as a comprehensive discussion of the advantages of the JServer implementation for enterprise application development, it explains the fundamentals of the JServer Java virtual machine and gives a technical overview of the tools that JServer provides.

In addition, the Oracle8i Java Developer's Guide describes the strategic advantages of the distributed component development model that is implemented by both EJBs and CORBA.

About Enterprise JavaBeans

Enterprise JavaBeans (EJB) is an architecture for developing transactional applications as distributed components in Java, and it is a powerful development methodology for distributed application development. Neither the bean developer nor the client application programmer need to be concerned with details such as transaction support, security, remote object access, and many other complicated and error-prone issues when developing with EJB. The EJB server and container furnish these features transparently for you.

Additionally, EJB applications are developed entirely in Java. It is not necessary for developers to learn a new language such as IDL.

Because of this simplicity, you can quickly develop applications that use EJBs; furthermore, EJBs offer portability. A bean developed on one EJB server should run on other EJB servers that meet the EJB specification. Portability has not currently been tested for most servers, but it is a promise for the future.

The Oracle8i JServer implements the EJB version 1.0 specification, providing a server and a container that hosts 1.0-compatible enterprise beans. The current release of JServer supports session beans only, as required by the specification. Entity beans will be supported in a future release.

EJB specifies Java Remote Method Invocation (RMI) as the transport protocol. Oracle8i JServer implements RMI over IIOP. Because the CORBA Internet Inter-ORB Protocol (IIOP) is the transport protocol for CORBA and for a future version of RMI, Oracle8i effectively enables direct object-oriented access to an array of open systems.

Stateful and Stateless Session Beans

The EJB specification calls for two types of session bean: stateless and stateful beans. Stateless beans--which do not share state or identity between method invocations--find use mainly in middle tier application servers that provide a pool of beans to process frequent but brief requests, such as those involved in an OLTP application. Stateful beans are useful for longer-duration sessions, in which it is necessary to maintain state, such as instance variable values or transactional state, between method invocations. Because the Oracle8i ORB and Java VM run under the multi-threaded server (MTS), the distinction between stateless and stateful session beans is not important for JServer. EJB activates both types of bean on demand in a new session. Stateful beans can offer the same performance as stateless beans, while preserving the advantages of stateful beans (their "conversational state").

Deployment Descriptor

EJB deployment is simplified by the following:

Oracle8i JServer complies with the EJB 1.0 specification and offers a highly scalable and high-performance execution environment for EJBs. The Oracle8i EJB implementation is able to leverage the Oracle database server and offers the following features:

About CORBA

CORBA, the Common Object Request Broker Architecture model, offers a well-supported international standard for cross-platform, cross-language development. CORBA supports cross-language development by specifying a neutral language, Interface Definition Language (IDL), in which you develop specifications for the interfaces that the application objects expose.

CORBA 2.0 supports cross-platform development by specifying a transport mechanism, IIOP, that allows different operating systems running on very different hardware to interoperate. IIOP supplies a common "software" bus that, together with an ORB running on each system, makes data and request transfer transparent to the application developer.

Although the CORBA standard was developed and promulgated just before the advent of Java and is a standard focused on component development in a heterogeneous application development environment, incorporating systems and languages of varying age and sophistication, it is perfectly possible to develop CORBA applications solely in Java. CORBA and Java are a good match.

For CORBA developers, JServer offers the following services and tools:

Common Features

CORBA and EJB have different strengths. CORBA was designed to support a heterogeneous application development environment, incorporating systems and languages of varying age and sophistication. The EJB specification was designed to bring Java within the realm of enterprise application development and to automate the most error-prone features of large-scale development.

Although they represent different development models, you will find that developing for either CORBA or EJB within the Oracle8i JServer framework offers a large degree of conceptual similarity.

Both EJB and CORBA leverage the capabilities of the Oracle8i database server, in particular the multi-threaded server. The threading model offered by the server simplifies not only the implementation of the ORB but the user's view of it.

With both EJB and CORBA applications, access to server-side objects is similar. You publish objects in the Oracle database using the OMG CosNaming service, which you can access using Oracle's JNDI interface to CosNaming. CORBA developers can also use the pure CosNaming approach. EJB developers must follow the EJB specification and use JNDI for access.

Figure 1-1 shows, in a schematic way, how applications access remote objects published in the database using JNDI.

Figure 1-1 Remote Object Access


The organization of this Guide reflects the partial similarity between EJB and CORBA. Chapter 2 covers EJB development, and Chapter 3 discusses CORBA. The important issues of session management, security, and client-side transaction control are not described independently for EJBs and CORBA because there are many similar aspects to them. Chapter 4 discusses the connection and authentication aspects of EJB and CORBA. Chapter 5 explains transactions.

IIOP

Oracle8i offers a Java interpreter for the IIOP protocol. Oracle embeds a pure Java ORB of a major CORBA vendor (VisiBroker for Java version 3.4 by Inprise) and repackaging the Visigenic Java IIOP interpreter to run in the database. Because Oracle8i is a highly scalable server, only the essential components of the interpreter are necessary--namely, a set of Java classes that do the following:

Oracle8i does not use the ORB scheduling facilities. The Oracle multi-threaded server performs the dispatching, enabling the server to process IIOP messages efficiently and in a highly scalable manner.

On top of this infrastructure, Oracle8i implements the EJB and CORBA programming models.

Tools

Oracle8i JServer comes with a complete set of tools for use in developing EJB and CORBA applications. You run these command-line tools from a UNIX shell or at a Windows NT DOS prompt. The tools allow you to compile IDL specifications, load Java classes or source files into the Oracle database, publish objects in the session name space, and display and manipulate published object names.

Chapter 6 of this Guide covers the tools.

In addition to the command-line tools JServer offers, you can use Oracle's JDeveloper tool suite to develop your distributed object applications.

Caffeine

JServer incorporates the Inprise (Visigenic) Caffeine tools that allow you to code object interfaces directly in Java and generate the infrastructure necessary to support distributed object invocation. These tools include:

Chapter 6 describes these tools.

Example Code

JServer comes with approximately 40 EJB and CORBA sample programs. These brief examples demonstrate all the major features of the product, including:

The examples come complete and ready to run, including a UNIX makefile and Windows NT batch file to compile and run each example. All you need is a Java-enabled Oracle8i database with the standard EMP and DEPT demo tables for some of the examples, and you can run the examples right out of the box.

The emphasis in these short examples is on demonstrating features of the ORB, EJBs, and CORBA, not on elaborate Java coding techniques. Even Java novices will be able to understand these examples with only brief study.

In addition to these sample programs, there are longer demos that contain more complete examples, including an example (acctMgmt) that uses several objects and is implemented using both EJB and CORBA, so that you can compare the two models.

The example and demo code are available on the distribution Compact Disc. See the README file that comes with JServer for the location and name of the archive file that contains the examples. Each of the examples includes a README file that tell you what files the example contains, what the example does, and how to compile and run the example.




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index