Download 1.3. Need of a Communication Program In An Office

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
I
İSTANBUL TEKNİK ÜNİVERSİTESİ
COMMUNICATION PROGRAM IN AN OFFICE
Graduation Project
Aslı Koçyiğit 498602
Filiz Ünlüşerefoğlu 498664
Advisor : Yrd. Dç. Feza BUZLUCA
July 2002
II
COMMUNICATION PROGRAM IN AN OFFICE
( SUMMARY )
1. Purpose Of Project
The main purpose of this project is to develop a program which provides communication and
coordination between personnel of an office. The application tools are Java 2 SDK Standart
Edition v 1.3.1 and Borland JBuilder 3.0 while Windows is the implementation platform.
2. Aim of Project

Learning the techniques of efficient Network Programming

Learning Java and developing programs using Java

Improving to write programs using Object Oriented Programming approach

Learning SQL
3. Context of Project
This program has two main features which provide the communication and coordination of a
staff in an office. The first one is sending message which can be useful in two ways: Instant
messaging with an online user and leaving a message to an offline user. The second one is file
transfer which enables file sharing between users.
III
1.
2.
INTRODUCTION .............................................................................................................. 6
1.1.
Need Of a Network Program .................................................................................. 6
1.2.
Reasons for Using Client/Server Architecture ....................................................... 6
1.3.
Need of a Communication Program In An Office ................................................. 7
1.4.
Reasons For Using Java ......................................................................................... 7
THEORETICAL INFORMATION ................................. Error! Bookmark not defined.
2.1.
History Of Java......................................................... Error! Bookmark not defined.
2.2.
Networking ............................................................... Error! Bookmark not defined.
2.2.1.
What is network? .............................................. Error! Bookmark not defined.
2.2.2.
Client/Server Architecture................................ Error! Bookmark not defined.
2.2.3.
Client/Server Communication .......................... Error! Bookmark not defined.
2.3.
Multithreading .......................................................... Error! Bookmark not defined.
2.3.1.
What is Multithreading? ................................... Error! Bookmark not defined.
2.3.2.
How does is work? ........................................... Error! Bookmark not defined.
2.3.3.
Benefits of Using Multithreading ..................... Error! Bookmark not defined.
2.3.3.1. Parallelism ....................................................... Error! Bookmark not defined.
2.3.3.2. Throughput ...................................................... Error! Bookmark not defined.
2.3.3.3. Responsiveness................................................ Error! Bookmark not defined.
2.3.3.4. Communications.............................................. Error! Bookmark not defined.
2.3.3.5. System Resources ............................................ Error! Bookmark not defined.
2.3.3.6. Distributed Objects .......................................... Error! Bookmark not defined.
2.3.3.7. Same Binary for Uniprocessors and Multiprocessors .... Error! Bookmark not
defined.
2.3.3.8. Program Structure ........................................... Error! Bookmark not defined.
2.4.
RMI .......................................................................... Error! Bookmark not defined.
2.5.
Using Java with Databases ....................................... Error! Bookmark not defined.
2.5.1.
JDBC API ......................................................... Error! Bookmark not defined.
2.5.2.
Steps Required to Access a JDBC Database .... Error! Bookmark not defined.
2.6.
Packages Used .......................................................... Error! Bookmark not defined.
2.6.1.
Java.io package ................................................. Error! Bookmark not defined.
2.6.2.
Java.lang package ............................................. Error! Bookmark not defined.
2.6.3.
Java.net package ............................................... Error! Bookmark not defined.
IV
3.
2.6.4.
Java.sql package ............................................... Error! Bookmark not defined.
2.6.5.
Java.rmi package .............................................. Error! Bookmark not defined.
2.6.6.
Java.util package .............................................. Error! Bookmark not defined.
APPLICATION ................................................................ Error! Bookmark not defined.
3.1.
Database ................................................................... Error! Bookmark not defined.
3.1.1.
Password Table ................................................ Error! Bookmark not defined.
3.1.2.
Status Table ...................................................... Error! Bookmark not defined.
3.1.3.
Message Table .................................................. Error! Bookmark not defined.
3.2.
Flow Chart of The Program ..................................... Error! Bookmark not defined.
3.2.1.
Logging into the Program ................................ Error! Bookmark not defined.
3.2.2.
The Program Interface ...................................... Error! Bookmark not defined.
3.2.3.
Send Message Panel ......................................... Error! Bookmark not defined.
3.2.3.1. Sending Message ............................................. Error! Bookmark not defined.
3.2.4.
Receive Message Panel .................................... Error! Bookmark not defined.
3.2.4.1. Reading an Incoming Message ....................... Error! Bookmark not defined.
3.2.4.2. Replying an Incoming Message ...................... Error! Bookmark not defined.
3.2.5.
Send File Panel ................................................. Error! Bookmark not defined.
3.2.6.
Receive File Panel ............................................ Error! Bookmark not defined.
3.2.7.
Logging Out of the Program ............................ Error! Bookmark not defined.
3.3. Classes & Interfaces Used In The Program .................. Error! Bookmark not defined.
3.3.1.
Classes and Interfaces of Java Packages ......... Error! Bookmark not defined.
3.3.1.1. Java.net package .............................................. Error! Bookmark not defined.
3.3.1.2. Java.io package ................................................ Error! Bookmark not defined.
3.3.1.3. Java.lang package ............................................ Error! Bookmark not defined.
3.3.1.4. Java.sql package .............................................. Error! Bookmark not defined.
3.3.1.5. Java.util package ............................................. Error! Bookmark not defined.
3.3.1.6. Javax.swing package ....................................... Error! Bookmark not defined.
3.3.1.7. Java.rmi package ............................................. Error! Bookmark not defined.
3.3.2. User Defined Classes ............................................. Error! Bookmark not defined.
3.3.2.1. Classes On the Client Side .............................. Error! Bookmark not defined.
3.3.2.1.1. Paket Class ........................................ Error! Bookmark not defined.
3.3.2.1.2. Mesaj Class: ...................................... Error! Bookmark not defined.
3.3.2.1.3. GroupThread Class: .......................... Error! Bookmark not defined.
3.3.2.1.4. FilePacket Class: ............................... Error! Bookmark not defined.
V
3.3.2.1.5. MyFile Class: .................................... Error! Bookmark not defined.
3.3.2.1.6. Parola4 Class: ................................... Error! Bookmark not defined.
3.3.2.1.7. Frame4 Class: ................................... Error! Bookmark not defined.
3.3.2.1.8. ServeClient Class: ............................. Error! Bookmark not defined.
3.3.2.1.9. ServerThread Class: .......................... Error! Bookmark not defined.
3.3.2.1.10. FileServerThread Class:.................. Error! Bookmark not defined.
3.3.2.1.11. FileThread Class: ............................ Error! Bookmark not defined.
3.3.2.1.12. QueryClient Class: .......................... Error! Bookmark not defined.
3.3.2.2. Classes On the Server Side .................................. Error! Bookmark not defined.
3.3.2.2.1. QueryImpl Class: .............................. Error! Bookmark not defined.
3.3.2.2.2. ServerSide Class: .............................. Error! Bookmark not defined.
3.3.2.2.3. ServeToClient Class: ........................ Error! Bookmark not defined.
4.
CONCLUSION ................................................................ Error! Bookmark not defined.
4.1. Assumptions .................................................................. Error! Bookmark not defined.
4.2. Results ........................................................................... Error! Bookmark not defined.
5.
REFERENCES ................................................................. Error! Bookmark not defined.
6
1. INTRODUCTION
1.1. Need Of a Network Program
Networking adds a lot of power to simple programs. With networks, a single program can
retrieve information stored in many computers located anywhere in the world. A single
network program can communicate with millions of people. In addition to these, network
programs give an opportunity to people to talk to each other.
Because of the reasons stated above network programming is one of the main issues
considered in the computer world.
1.2. Reasons for Using Client/Server Architecture
The client/server computing model provides the means to integrate personal productivity
applications for an individual employee or manager with specific business data processing
needs to satisfy total information processing requirements for the entire enterprise.

Enhanced Data Sharing : Data that is collected as part of the normal business process
and maintained on a server is immediately available to all authorized users. The use of
Structured Query Language (SQL) to define and manipulate the data provides support for
open access from all client processors and software. SQL grants all authorized users
access to the information through a view that is consistent with their business need.
Transparent network services ensure that the same data is available with the same
currency to all designated users.

Integrated Services : In the server/client model, clients does not need to change into
terminal mode or log into another processor to access information. All authorized
information and processes are directly available from the desktop interface.

Sharing Resources Among Diverse Platforms : Applications may be created and
implemented without regard to the hardware platforms or the technical characteristics of
the software. Thus, users may obtain client services and transparent access to the services
provided by database, communications, and applications servers. Operating systems
software and platform hardware are independent of the application and masked by the
development tools used to build the application.
7

Data Interchangeability and Interoperability : Almost all the development tools used
for client/server development expect to reference a back-end database server accessed
through SQL. Network services provide transparent connectivity between the client and
local or remote servers.
1.3. Need of a Communication Program In An Office
A communication software is designed to be used by groups of people sharing information
and working together. It lets a group of people use the same information-but often- times in
different ways depending on their particular needs.
More specifically, a communication software for an office helps to manage the particular
needs of a worker such as exchanging mail, sharing ideas, accessing information, and
planning for the future. By using one simple program, a worker can reduce the time to
accomplish all of these tasks and increase his performance.
1.4. Reasons For Using Java
According to Sun Microsystems, Java is "simple, object-oriented, statically typed, compiled,
architecture neutral, multi-threaded, garbage collected, robust, secure, and extensible."
Reasons of usage is summarized below:

Simple. Java's developers deliberately left out many of the unnecessary features of
other high-level programming languages. For example, Java does not support pointer
math, implicit type casting, structures or unions, operator overloading, templates,
header files, or multiple inheritance.

Object-oriented. Just like C++, Java uses classes to organize code into logical
modules. At runtime, a program creates objects from the classes. Java classes can
inherit from other classes, but multiple inheritance, wherein a class inherits methods
and fields from more than one class, is not allowed.

Statically typed. All objects used in a program must be declared before they are used.
This enables the Java compiler to locate and report type conflicts.

Compiled. Before you can run a program written in the Java language, the program
must be compiled by the Java compiler. The compilation results in a "byte-code" file
that, while similar to a machine-code file, can be executed under any operating system
8
that has a Java interpreter. This interpreter reads in the byte-code file and translates the
byte-code commands into machine-language commands that can be directly executed
by the machine that's running the Java program. You could say, then, that Java is both
a compiled and interpreted language.

Multi-threaded. Java programs can contain multiple threads of execution, which
enables programs to handle several tasks concurrently. For example, a multi-threaded
program can render an image on the screen in one thread while continuing to accept
keyboard input from the user in the main thread. All applications have at least one
thread, which represents the program's main path of execution.

Garbage collected. Java programs do their own garbage collection, which means that
programs are not required to delete objects that they allocate in memory. This relieves
programmers of virtually all memory-management problems.

Robust. Because the Java interpreter checks all system access performed within a
program, Java programs cannot crash the system. Instead, when a serious error is
discovered, Java programs create an exception. This exception can be captured and
managed by the program without any risk of bringing down the system.

Secure. The Java system not only verifies all memory access but also ensures that no
viruses are hitching a ride with a running applet. Because pointers are not supported
by the Java language, programs cannot gain access to areas of the system for which
they have no authorization.

Extensible. Java programs support native methods, which are functions written in
another language, usually C++. Support for native methods enables programmers to
write functions that may execute faster than the equivalent functions written in Java.
Native methods are dynamically linked to the Java program; that is, they are
associated with the program at runtime. As the Java language is further refined for
speed, native methods will probably be unnecessary.

Well-understood. The Java language is based upon technology that's been developed
over many years. For this reason, Java can be quickly and easily understood by anyone
with experience with modern programming languages such as C++.