You are on page 1of 29

Developing Banking application

with VisiBroker Edition


Chi-Hua Chen, Chang-Min Chen, Yin-Lung Lu
Ming-Chia Li, Hsin-Ying Hsieh, Ying-Yu Lin, Cchia-Wei Hsu
Institute of Information Management,
National Chiao Tung University, Hsinchu, Taiwan.
Developing Banking application with VisiBroker Edition

Contents
1 Introduction ..................................................................................................... 2
2 Objective .......................................................................................................... 2
3 Hardware & Software Environment............................................................... 3
3.1 Hardware ................................................................................................... 3
3.2 Software...................................................................................................... 3
4 Approach(Design) ............................................................................................ 3
5 Development sample........................................................................................ 3
5.1 Development process............................................................................ 5
5.2 Implement System Functions............................................................... 6
5.2.1 Defining Object Interfaces ....................................................... 7
5.2.2 Implementing the client............................................................ 8
5.2.3 Implement the Server Side ....................................................... 9
5.2.4 Implement the Security Guard .............................................. 10
6 Results (Execution) .........................................................................................11
6.1 Building the Project ............................................................................11
6.2 Running the Application .....................................................................11
7 Alternatives.................................................................................................... 16
7.1 Future Work and Improvement ........................................................ 16
7.1.1 Combine different databases.................................................. 16
7.1.2 Transaction management ....................................................... 16
7.1.3 Integrated different program languages................................ 16
7.1.4 Security ................................................................................... 16
8 Discussion and Conclusion (Problem Encountered)..................................... 17
9 References ...................................................................................................... 17
Appendix : Illustration of setting up the VisiBroker ................................................ 18

1 /29
Developing Banking application with VisiBroker Edition

1 Introduction
VisiBroker Edition provides a complete CORBA (Common Object Request
Broker Architecture) 2.4 ORB (Object Request Broker) runtime and supporting
development environment. We can build, deploy, and manage distributed the Java
applications that are open, flexible, and inter-operable by VisiBroker.
The CORBA allows distributed applications to interoperate (application to application
communication), regardless of what language they are written in or where these
applications reside. CORBA uses an object-oriented approach for creating software
components that can be reused and shared between applications. Each object
encapsulates the details of its inner workings and presents a well defined interface,
which reduces application complexity. The cost of developing applications is reduced,
because once an object is implemented and tested, it can be used over and over again.
The ORB connects a client application with the objects it wants to use. The client
program does not need to know whether the object implementation it is in
communication with resides on the same computer or is located on a remote computer
somewhere on the network. The client program only needs to know the object's name
and understand how to use the object's interface. The ORB which takes care of the
details of locating the object, routing the request, and returning the result is shown as
Fig. 1.

Fig. 1 Client program acting on an object

2 Objective
Use VisiBroker to develop an example application to describe the development
process for creating distributed, object-based applications for Java. Learn the process

2 /29
Developing Banking application with VisiBroker Edition

of middleware development, and understand the CORBA infrastructure and how it


works.

3 Hardware & Software Environment


3.1 Hardware
AMD Semprom(tm) 1.00 GHz
512 MB RAM, Physical Address Extension

3.2 Software
Windows XP Professional Version 2002, Service Pack 2
Java Runtime Environment 1.5.0 (J2SE)

4 Approach(Design)
VisiBroker which is made by Borland is the most widely deployed CORBA ORB
infrastructure product on the market. It can be downloaded from Borland web site
(http://www.borland.com/us/products/visibroker/index.html).The details of VisiBroker
installation and implementation, shown as appendix.

5 Development sample
The following figure illustrate the functions of the sample bank application. There are
four parts in our sample: end user(client)、IIM bank(server1)、Security
guard(server2)、FIRST bank(server3).

3 /29
Developing Banking application with VisiBroker Edition

Fig. 2 The sample bank application diagram


 :End user is one of the customer of IIM bank who can use
End user (Client):
the customer interface provided by IIM bank to send request to IIM bank.
There are five functions (check balance、deposit、withdrawal、transfer and
crossing bank transfer)that users can operator by using customer interface,
show as the fig. 2.

 IIM Bank (Server1): IIM bank is a server side which receive the requests
from the end users and accomplish the demands of the users.

 Security guard (Server2): Security guard is a server of the security company,


receive the user account and password from the server of IIM bank. The job of
Security guard is to check the validation this account and the correction of the
password.

 FIRST bank (Server3): In our sample, the user(customer of IIM Bank) can
transfer credit to another account which doesn’t belong to IIM Bank. FIRST
bank stands for the another bank.

4 /29
Developing Banking application with VisiBroker Edition

5.1 Development process


When we develop distributed applications with VisiBroker Edition, we first
identify the objects required by the application. The steps of develop a sample bank
application are shown as Fig. 24. Here is a summary of the steps taken to develop the
bank sample:
1. Write a specification for each object using the Interface Definition
Language (IDL). IDL is the language that an implementer uses to specify
the operations that an object will provide and how they should be invoked.
In this example, we define, in IDL, the Account interface with a balance()
method and the AccountManager interface with an open() method.
2. Use the IDL compiler to generate the client stub code and server POA
servant code. With the interface specification described in step 1, use the
idl2java (Java) compiler to generate the client-side stubs (which provide the
interface to the Account and the AccountManager objects' methods) and the
serverside classes (which provides classes for the implementation of the
remote objects).
3. Write the client program code. To complete the implementation of the
client program, initialize the VisiBroker ORB, bind to the Account and the
AccountManager objects, invoke the methods on these objects, and print out
the balance.
4. Write the server object code. To complete the implementation of the
server object code, we derive from the AccountPOA and
AccountManagerPOA classes, provide implementations of the interface's
methods, and implement the server's main routine.
5. Compile the client and server code. To create the client program, compile
the client program code with the client stub. To create the Account server,
compile the client program code with the server stub.
6. Start the server.
7. Run the client program.

5 /29
Developing Banking application with VisiBroker Edition

Fig. 3 The sample bank application developing

5.2 Implement System Functions

Fig. 4 The procedures of the sample bank application works

6 /29
Developing Banking application with VisiBroker Edition

5.2.1 Defining Object Interfaces


The CORBA Interface Definition Language (IDL) is used to define interfaces to
objects in your network. The first step in developing a CORBA application is to
define the interfaces to the objects required in your distributed system. To define these
interfaces, we use CORBA IDL. We can implement IDL interfaces using any
programming language for which an IDL mapping is available, including C++, Java,
and Smalltalk. Here, we use the idl2java compiler to generate routines and servant
code compliant with the IDL specification.
IDL can be used to define modules, interfaces, data structures. Its module defines
a naming scope for a set of IDL definitions. The interfaces Account and
AccountManager are scoped within the module Project1. Then the Account interface
provides six methods for passing parameter of the username, obtaining the current
balance, depositing, withdrawing, and transferring in the intra-bank and inter-bank.
The AccountManager interface creates an account for the user if one does not already
exist.
module Project1 {
interface Account {
float getBalance();
void setName(in string name);
void deposit(in long amount);
long withdrawal(in long amount);
void transfer(in string accName, in long amount);
void crossingBankTransfer(in string bankName, in string accName,
in long amount);
};
interface AccountManager {
void createAccount(in string name, in string pw);
Account getAccount(in string name, in string pw);
};
};

7 /29
Developing Banking application with VisiBroker Edition

5.2.2 Implementing the client

Get Balance

Deposit

Withdrawal
Account
Intra-bank
Client user
Transfer

CrossingBank
Transfer

The Client. java file is included in the Project1 directory. The Client class
implements the client application which divides into two partitions for different
clients.
 General user: It is clearly to know that the user directs at the IIMBank
server. The client user can make reasonable requests such as get the current
balance, deposit, withdraw, and transfer action from the IIMBank server.
 IIMBank: For this part, it can be subdivided into two conditions. The first
situation is that the IIMBank directs at the Security Guard server. When
someone inputs the username and password for entering the IIMBank
system, the IIMBank will apply to the Security Guard server for verifying
user. If returns true, the IIMBank will invokes Account object to execute
their requests. The other situation is that if the IIMBank account who wants
to implement inter-bank transfer, then first the IIMBank will apply to the
Security Guard server for getting the authority. If return true, it will become
the “client” to ask for FirstBank server executing the deposit. The
above-mentioned two conditions show that IIMBank maybe as a client if
necessary.

The bank client program performs these steps:


1. Initializes the VisiBroker ORB.
2. Binds to an AccountManager object.

8 /29
Developing Banking application with VisiBroker Edition

3. Obtains an Account object by invoking open on the AccountManager


object.
4. Implements the requests of users by invoking attribute on the object.
5. Print the results.
How easy it is to invoke the remote Account object; it’s just like calling a local
Java object. To invoke these methods, we must first obtain an object reference. This is
where the bind() method of the AccountManagerHelper class comes into play.
Furthermore, this is one of the Java classes idl2java created for us. The bind() method
requests the VisiBroker ORB to locate and establish a connection to the server.
If the server is successfully located and a connection is established, a proxy
object is created to represent the server's AccountManagerPOA object. An object
reference to the AccountManager object is returned to the client program.

5.2.3 Implement the Server Side

Enter the
Username & SecurityGuard
Password Wrapper
AccountManagerImpl SecurityManagerImpl

Login Verify

True

Account

CrossingBank
Get Balance Deposit Withdrawal Transfer
Transfer

IDBmanager

DBMysqlManager

While receiving the login information(user account and password) from the
user(client side), IIM server passes this information to security guard immediately and

9 /29
Developing Banking application with VisiBroker Edition

waits for the return that whether the login is success or not. Until receiving the return,
IIM bank server provides services for the user. All the five functions (check
balance、deposit、withdrawal、transfer and crossing bank transfer) need to access the
database, for connecting database the function module have to using “IDBmanager”
to communicate with “DBMysqlManager”, and the “DBMysqlManager” can access
the database directly. Because of connecting to other bank, there are additional steps
for completing the crossing bank transfer function. At first, IIM bank server needs to
get authority from the security guard to make sure IIM bank has the privilege for
connecting to FIRST bank. Then passes the user account which is in the FIRST bank
to the FIRST bank server, deposits credit in the FIRST bank account and withdrawal
credit in the IIM bank account simultaneously.

5.2.4 Implement the Security Guard

There are two main tasks of Security Guard:


 Login information checking
When receiving login information from bank server, security guard will check the
validation of the user account and the correction of the password, then return the
result to the bank server.
 Bank management authority
When processing the crossing bank transfer function, IIM bank will send request
to the Security Guard to get the authority to creating a connection with FIRST bank.
The job of Security Guard is that examining if IIM bank with the privilege to login
FIRST bank.

10/29
Developing Banking application with VisiBroker Edition

6 Results (Execution)
6.1 Building the Project
In VisiBroker command prompt, type vbmake in the project folder. (see
the next section to know now to start the VisiBroker command promptj).

6.2 Running the Application


First, start the VisiBroker Smart Agent, as the following figure.

Fig. 5 Starting the VisiBroker Smart Agent and entering VisiBroker command prompt.

Then starting the IIM bank server ,FIRST bank server and Security Guard server.
Finally, starting the customer interface (client side), the operating steps show as the
following figures.

11/29
Developing Banking application with VisiBroker Edition

Fig. 6 User login interface

Fig. 7 User operating functions interface

12/29
Developing Banking application with VisiBroker Edition

Fig. 8 Withdrawal interface

Fig. 9 Finish the withdrawal

13/29
Developing Banking application with VisiBroker Edition

Fig. 10 Crossing bank transfer –choosing the other bank

Fig. 11 Crossing bank transfer –Entering the account of the acceptor and the figures

14/29
Developing Banking application with VisiBroker Edition

Fig. 12 Finish the crossing bank transfer

Fig. 13 Extra-functionn: Account interest increasing module .

15/29
Developing Banking application with VisiBroker Edition

7 Alternatives
7.1 Future Work and Improvement
7.1.1 Combine different databases
In order to simplify our study, we use the same database to implement
Bank Agent. In the future, we can use different database for different bank.
For examples, the Bank A maybe use MySQL, and Bank B maybe use
Oracle, both two can communicate with each other. For this reason, we can
integrate heterogeneous applications.

7.1.2 Transaction management


A transaction ensures that the action of the framed statements is atomic
with respect to recovery. For example, the COMMIT Statement is used to
commit (make persistent) all changes for the current transaction, and the
ROLLBACK Statement is used to roll back all changes for the current
transaction.
Furthermore, transactions are executed under a client connection to the
DBMS. Multiple client connections can initiate transactions at the same time.
This is known as concurrent transactions, each transaction is completely
isolated from other active transactions. After initiation, a transaction can only
see changes to the database made by transactions committed prior to starting
the new transaction.

7.1.3 Integrated different program languages


CORBA is an open and cross-platform solution. In our study, we used
Java language to implement Bank-agent example. In the future, we used C++
language to implement it, so we can integrate different program languages in
VisiBroker.

7.1.4 Security
Security is the most basic problem of information system. Therefore, we
must provide some security mechanism for transaction. The OMG Security
Specifications provide many security-related specifications. For example,
CSIv2 and CORBA Security Service, provide security enhancements to the
CORBA infrastructure. Those detailed specifications may be found within
the CORBA/IIOP and CORBAservices respectively.

16/29
Developing Banking application with VisiBroker Edition

8 Discussion and Conclusion (Problem


Encountered)
In this case, while we try to modify the bank example by using JAVA
language, we also take the functions a real bank should have into consideration.
In addition to the original deposit and drawing functions, we also considered one
character of CORBA, which is to enable the communications between two
different suppliers. So we added the functions of transfer and simple security into
our case.

We run CORBA on the same host in this practice, but we hope that we can
improve it on the distributed two computers. Besides, we were also in trouble
when we were coding in JAVA language, which was an unexpected situation we
met. Furthermore, just like the improvements we talked about, we still have to
work harder in the communications between different environments, including
the databases and the languages, as well as in the very important part, the
information security. As the advancement of information technology, more and
more companies are using different platforms and environments. Although we
have not realized the conversation between two different hosts so far, we do
appreciated the “Interoperability” in CORBA and learned some lessons. It is
hoped that we can have further understanding of CORBA.

9 References
[1] Voge, Andreas, Duddy, Keith, Java Programming with CORBA. New York,
NY: J. Wiley., 1997
[2] Orfali, Robert, Harkey, Dan, Client/Server programming with Java and
CORBA. New York, NY: Wiley Computer Publishing, 1997
[3] APPCENTER, AppCenter V1.6 Frequently Asked Questions,
http://info.borland.com/devsupport/appcenter/faq/faq16.html
[4] VisiBroker for Java – Developer’s Guide, Borland Software Corporation, 2006

17/29
Developing Banking application with VisiBroker Edition

Appendix : Illustration of setting up the VisiBroker


 Download

Fig. 1 Borland VisiBorker web site

Fig. 2 Borland VisiBorker product trial

18/29
Developing Banking application with VisiBroker Edition

Fig. 3 Get activation file

Fig. 4 Download Borland Visibroker

19/29
Developing Banking application with VisiBroker Edition

 Installing
After downloading Borland Visibroker (such as vb7-06.06.C3.02-windows-x86.exe),
we double-click the file to install in following Fig. 6~19.

Fig. 5 Begin installing Borland Visibroker

Fig. 6 Accept the terms of the license agreement

20/29
Developing Banking application with VisiBroker Edition

Fig. 7 Choose install folder

Fig. 8 Choose product components

21/29
Developing Banking application with VisiBroker Edition

Fig. 9 VisiBroker core configuration

Fig. 10 Choose VisiBroker services

22/29
Developing Banking application with VisiBroker Edition

Fig. 11 Choose install type

Fig. 12 Pre-install summary

23/29
Developing Banking application with VisiBroker Edition

Fig. 13 Installing Borland Visibroker

Fig. 14 Registration

24/29
Developing Banking application with VisiBroker Edition

Fig. 15 Borland Visibroker registration wizard

Fig. 16 Import activation file

25/29
Developing Banking application with VisiBroker Edition

Fig. 17 Register successfully

Fig. 18 Finish installing Borland Visibroker

26/29
Developing Banking application with VisiBroker Edition

 Setting
Before using VisiBroker Edition, we set several environment variables. Although the
DOS set command can be used to set environment variables in Windows NT, we may
find it easier to use the System control panel to automatically set the PATH. Assuming
that the VisiBroker Edition distribution is installed in C:\Borland\VisiBroker, do the
following steps to edit the PATH variable in System control panel:
1. Open the System control panel.
2. Select the Environment Variable button in the System properties window.
3. Choose "PATH" as the variable to edit.
4. Click the Edit button to edit the variable value.
5. Add the following to the PATH:
C:\Borland\VisiBroker\bin;

Fig. 19 System control panel

27/29
Developing Banking application with VisiBroker Edition

Fig. 20 Select the environment variable button

Fig. 21 Choose "PATH" as the variable

Fig. 22 Edit the variable value

28/29

You might also like