![]() |
Middleware: Visigenic CORBA/JAVA |
CORBA
provides a distributed, object-oriented, client-server infrastructure while
JAVA provides a platform-neutral and objected-oriented programming language,
development and deployment environment. The Trade Order Management System
was designed from the ground-up to showcase these features.
After analyzing the trade
order business logic, we identified the objects that make up the system.
These are the order object and the customer object. In CORBA terminology,
our clients are the customer log-in and order entry prompts. They were
written as as applets so that they can be downloadable to the Web browser.
The Order Entry applet is a CORBA client. It invokes the Corba init() method to initialize the Object Request Broker (ORB). It then binds to the ORB to locate the server that will service its requests. It creates an instance of Order Manager class by invoking the ORB's bind method. An Order Manager object is basically a software factory for creating Order objects. There can be several of these Order Manager objects running at the same time and at different remote sites. They are given names to allow a client to choose a particular instance of the object. When the ORB finds the server that implements the Order Manager object, a "session" is established. When the client applet sends an order, the Order Manager creates an order object. An order number, timestamp and confirmation are generated and sent back to the client. The order is persisted by
writing to a relational file using Java Database Connectivity (JDBC) interface.
It can then be retrieved by the client to check the order's status
or for the broker to fill.
3. IDL Generated An Interface Definition Language (IDL) is a software specification that facilitates the development of object interfaces in CORBA. Sun Microsystems provides a program called idl2java which maps IDL definitions to Java language definitions. For this project, we created a file called Order.idl that contains the trade order system's interfaces. They are described in later sections. The idl2java compiler creates the following files: For the Order and OrderManager
class declarations:
For the Order and OrderManager
type holders:
For the Order and OrderManager
helper classes:
For the Order and OrderManager
implementation abstract classes:
We had to write codes for
the Order and OrderManager implementation.
Finally, codes are needed
to be written for the client and server applets and applications.
For the CustomerAccount interface,
the following are generated and written similar to the Order and OrderManager
interfaces:
The following describes the interfaces using CORBA IDL. Order Interface Order.idl contains the IDL
for the Order interface. The following is the listing for the Order interface.
Order Interface Members and Methods Descriptions
This represents the order instruction where the valid values are 'B' for buy and 'S' for sell. This represents the number of shares of securities to buy or sell. This represents the security symbol to buy or sell. This represents the timestamp generated by the Server as soon as it receives a valid order.
This represents the order serial number generated by the Server as it receives a valid order.
This represents a customer account number.
This represents the timestamp generated by the Server as soon as the executing broker fills the order.
This method will display the Order information. The Order.idl also contains the IDL for the OrderManager interface. The OrderManager as the name implies manages the messages intended for the Order object. When the OrderManager receives a request to send an order or list an order, it creates an Order object by passing the necessary information retrieved from the user interface or the data store. The following is the listing
for the OrderManager interface.
interface OrderManager
void listOrder(in long customerAccountNo);
The OrderManager interface
has two methods: sendOrder() and listOrder(). Conceptually,
The listOrder() method, on
the other hand, retrieves the persisted Order object whose
This method takes as input the customer account number (customerAccountNo), buy/sell instruction (OrderCode), quantity (orderQuantity), and security symbol (orderTicker). If there are no errors, it then instantiates the Order class while supplying these fields. In addition, the OrderManager generates an order number (orderNo), a timestamp (orderTimeStamp), and an order confirmation (confirmation).
This method takes as input the customer account number (customerAccountNo), retrieves the information from the data store and use them to create an Order object. The Order.idl also contains the IDL for the CustomerAccount interface. The CustomerAccount object handles user authentication. The client enters name and the CustomerAccount implementation invokes its method to check if the user is a valid user and the password entered is correct. The following is the listing
for the CustomerAccount interface.
interface CustomerAccount
CustomerAccount Interface Members and Methods Descriptions
This represents the account number of the client. For each name in the client database there is an associated password.
This method accepts the client name and password, and checks the database if the client is a valid user of the system. This is used during logon. |
|