# Banking on CORBA

This is a simple implementation of a banking application. The architecture of the bank has three components:

- A database that provides persistent storage for the accounts managed by the bank.
- A CORBA server that represents the bank and provides an object-oriented interface to its accounts.
- A CORBA client that provides a graphical user interface to the bank.

This application is a typical example of a three-tier application architecture comprising a database access layer, a business logic layer, and a user interface layer.

The client program is composed of the following parts:

library.dylan
  Dylan library definition for client
module.dylan
  Dylan module definition for client
bank-client.dylan
  Dylan client GUI
init-client.dylan
  Dylan client initialization
idl.spec
  client configuration file for Bank IDL
naming.spec
  client configuration file for Naming Service IDL
README.htm
  this file

The server program is similarly composed of the following parts:

library.dylan
  Dylan library definition for server
module.dylan
  Dylan module definition for server
bank-server.dylan
  Dylan server implementation
server-frame.dylan
  Dylan server GUI
init-server.dylan
  Dylan server initialization
idl.spec
  server configuration file for Bank IDL
naming.spec
  server configuration file for Naming Service IDL
README.htm
  this file

See the bank chapters of the CORBA documentation for a more information on this demonstration and its features.

Also see the separate README for the Java version of the Bank client.

## ODBC requirements

In order to run the example, you need to have ODBC version 3.0 (or higher) and an ODBC driver for Microsoft Access installed on the machine hosting the server application. You do not need a copy of Microsoft Access.

Both ODBC 3.x and the Microsoft Access driver are available free for download from the Microsoft Universal Data Access web site.

From the Downloads section, download the Microsoft Data Access Components, version 1.5c or higher, for your Windows platform. You do not need to download the full 6.4MB file -- mdacfull.exe, the MDAC 1.5c redistribution setup file, is only 3.4MB and contains everything you need.

This file installs ODBC 3.x and the Microsoft Access Driver, amongst other things.

This information may change in the future.

## Building and Testing the Application

Just press the "Build" buttons on the respective Project Windows.

Now, you can run the application to test that it works. You need to run the server first so that it is waiting ready to receiver calls from the client.

- Select "Project->Start" or press the "Start/Resume" button in the tool bar on the Project Window for the "bank-server" project.
- Wait until the GUI appears. The server is now running.
- Do the same for the client project. It should also start a GUI.
- In the client, create an account by select "Open New Account..." from the "Bank" menu.
- Now you can credit some money to it by selecting "Credit Account..." from the "Account" menu (in the client).
- Close the client GUI and restart it.
- In the client, retrieve the account you created using "Retrieve Account..." from the "Bank" menu.
- In the server, select "active log" in the server GUI to monitor requests from the client.

You can set breakpoints in the client and server code to trap the request and open debugger windows as it passes from client to server, or you can experiment and extend the code, e.g. by reducing the number of CORBA requests needed to redisplay the client's table of accounts (e.g. by caching the details in the client, or by sending the details in a structure instead of as separate values).