Project Notes


Project:Cliffhanger Credit Card Application (CORBA sample)

Author: Kevin Minard

Description:
This sample provides an example of a credit approval/credit card issuing system for Cliffhanger Adventure Gear, a fictitious company selling outdoor adventure gear. The project notes in samples/OrderEntry/OrderEntry.html give a detailed description of the Cliffhanger application and database. The company also requires an automated system for processing the credit history of an applicant to determine if a credit card should be issued. If a card is issued, the system calculates the credit limit and expiration date for the account. This sample is that system.

The sample consists of two JBuilder projects, a Credit Approval Server application and a Credit Approval Client applet/application. The Credit Approval Server and Client 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 server callbacks are demonstrated. The server also uses JBuilder's DataExpress database components to enforce business rules and save credit card and customer credit history into a database.  For simplicity, the client and server are set up to run on the same machine.  However, by simply running a VisiBroker Smart Agent somewhere on your local network, you can run the application on separate client and server machines, without having to modify any code.  Also, just by changing the JDBC URL and driver (one line of code), you can have the CORBA server object save data to its database on any machine.

Setup
To run this sample, you must

Running the Sample
To run the CORBA sample, follow this order of events:

  1. Start the VisiBroker Smart Agent.  From the JBuilder menu, select Tools | VisiBroker Smart Agent.
  2. Ensure InterBase and InterServer are running.
  3. Start the Credit Approval Server.  Select Run | Run project from the main menu to start the CORBA server. You should see the message "Awaiting client requests" in the message pane when the server is ready to accept client requests.
  4. Start the Credit Approval Client.  Click the small arrow to the right of the "Run Project" button on the main toolbar to display the project's list of runnable configurations, and select one of the client configurations. Enter the data required to apply for a credit card and click the Submit button. The request is sent to the server, which processes it and sends a response back to the client applet.



Cliffhanger Adventure Gear Credit Approval Server

Description:
The Approval Server is responsible for reviewing an applicant's credit history and making a determination as to whether the applicant should 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:

  1. The Cliffhanger Database: This database contains Cliffhanger Credit Card account information such as card holder information, credit card number, expiration date, balance, credit limit and account status.  Records are created in this database when an applicant is issued a credit card.
  2. The ACME Credit Bureau Database: This database contains account history for all active/inactive accounts of people tracked by the ACME Credit Bureau.  This database is used in the Credit Card Approval process. Since using real credit history information is not feasible, this database is populated using randomly generated, fictional sample data.


The Credit Approval Server notes are divided into discussions of demonstrated features as follows: 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, right-clicking on the file in the project pane and selecting "Make" or "Rebuild" from the menu will generate the corresponding Java interface, stub, and skeleton classes.  For this project, these generated classes are located in the CreditApprovalCORBAInterface package.

The CreditApproval.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:

CreditApprovalDispenserImpl Class demonstrates the following: CreditApprovalImpl 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:




Cliffhanger Adventure Gear Credit Approval Applet
 

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:

The ClientCallbackImpl class demonstrates the following: The CreditApprovalApplet 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.  When the user attempts to submit an incomplete form, the applet displays a message to the user indicating the missing required field and then sets focus to that field.

The ApplicationFormPanel class demonstrates the following: