Project: CORBA Reference Application
Author: Kevin MinardDescription:
This sample provides an example of a credit approval/credit card issuing
system for a fictitious company selling outdoor adventure gear. The company,
Cliffhanger Adventure Gear, requires an automated system for processing
the credit history of an applicant to determine if a credit card should
be issued. If a credit card is issued, the system calculates the
credit limit and expiration date for the account.
The sample consists of two JBuilder projects, a Credit Approval Server application and a Credit Approval Client applet. The Credit Approval Server and Credit Approval Applet communicate by means of a set of CORBA objects, illustrating how to create and use CORBA objects in JBuilder. Generation of Java code from IDL source, a server application, a client applet, and a callback are demonstrated. For simplicity, the client and server are set up to run on the same machine. This sample also provides an example of using JBuilder's DataExpress database components to enforce a set of business rules.
Setup
To run this sample, you must
Note: All versions of JBuilder provide direct access to SQL data through the JavaSoft JDBC API. Some versions of JBuilder provide additional DataExpress components (on the Data Access tab of the Component Palette) that greatly simplify RAD visual development of database applications. Refer to the JBuilder product page from the Borland Web site for availability of features in each JBuilder version.
Executing the Sample
To execute the CORBA sample, follow this order of events:
Other documentation and data files
One other document included in this sample, Reusable
Code, highlights some of the reusable code snippets from this sample
project that might be useful for your own JBuilder projects.
In addition to the InterBase database ACMECreditBureau.GDB, this application's Db directory contains text files that can be used to generate clean copies of the CLIFFHANGER.GDB and ACMECreditBureau.GDB databases. To use them:
Description:
The Approval Server is responsible for reviewing an applicants credit
history and to make a determination as to whether the applicant should
or should not be approved for a Cliffhanger Credit Card. The server
also issues credit cards to approved applicants consisting of a credit
card number, an expiration date and a credit limit.
The server uses two databases:
Using IDL to Generate Java Classes
The first step in creating CORBA objects is defining their interfaces
using IDL. The IDL defined interfaces for this project are located in CreditApproval.idl.
Interfaces only need to be created for objects that are going to be distributed
using CORBA.
Once these interfaces have been defined, use JBuilder's CORBA Settings
Wizard (from Tools | CORBA Settings) to create Java helper interfaces and
classes. For this project, these generated classes are located in the
CreditApprovalCORBAInterface package. Files generated with the
_example_ prefix demonstrate how to use the Java classes and
interfaces generated by the wizard.
The CreditApprobal.idl interface file demonstrates the following:
ORB Usage
CORBA Class implementation, initialization, registration and usage
are demonstrated by the following classes:
CreditApprovalServer Class demonstrates the following:
Data Module
Three data module classes are used in this sample. These classes
contain Database components, QueryDataSet components, and all
the business rules logic. Data modules simplify reuse and multiple use
of collections of dataset components.
One of these data modules, the CreditHsitoryReviewer class, demonstrates the following:
Description:
The Credit Approval Applet is used to collect information from the
user to be processed by the Credit Approval Server.
The Credit Approval Applet notes are divided into discussions of demonstrated features as follows:
ORB Usage
This Applet uses CORBA to communicate with the server. To receive
status information, the applet creates a callback CORBA object that is
passed to the server. The following classes demonstrate ORB usage:
The CallbackThread class demonstrates the following:
Required Field Processing
Required field processing is an important part of data entry.
A form cannot be submitted for processing until all required fields are
complete. The applet uses a couple of techniques to notify the user of
missing required fields.