Вы находитесь на странице: 1из 28

ANNEXURE - VIII

DECLARATION

I hereby declare that the project work entitled (“ Chat Application System ”) is an authentic
record of my own work carried out at (Thapar University Patiala India) as requirements of
six weeks project term for the award of degree of B.E (Computer Engineering) , Thapar
University , Patiala under the guidance of ( Dr. A.K VERMA \ AJAY KUMAR ) , during 31
may to 09 july , 2010.

Signature Of Candidate :

Date : 12/Nov/2010 Name Of Candidate : Yug Dutt Choudhary

Roll No Of Candidate : 100803111


ACKNOWLEDGEMENT

I wish to express my heart-felt thanks to everyone who helped me to complete this project. I
would like to thanks Dr. A.K VERMA for providing me the opportunity to undertake the B.E
Training Project.

Everyone knows that efficient work is nothing but mutual coordination between two or more
people. For me it was very difficult to make a real time project without the help of people
surrounding me.

I extremely thankful to Thapar University Patiala , Punjab for providing me the training in
their organization between the environments of project work.

I would like to express gratitude towards Dr .A.K VERMA (Training Coordinator) and Mr. AJAY KUMAR
(Trainer) for their logistic help. With the help of scientific people it is very easy to complete this project
under these people in the organization.

I would like to thank my parents for their moral support. Last but not least, thanks to the
almighty that was always with us.
SUMMARY OF PROJECT “CHAT APPLICATION”

The life has become very busy these days. Everyone dreams for a LAMP OF ALLADIN which
could do all chat application which could make the world smaller. This portal is a step forward to
make that dream come true. I have tried to give a new vibrant feel to networking. This portal has
made communicating as easy as a dream. It has many user friendly features to make your
communication simple , easy and entertaining.

With the growth of internet and web portals there are day by day increasing trends of online
social networking websites are coming up with vast range of features and integrated option of
connecting to whole world in just seconds. With in a few seconds client can communicate and
even share there memories with his friends .

1.1 Advantages of chat clients server application

 You meet new people.


 You exchange your views about certain subjects .
 You can relax because you don't have to see the person physically .
 If you are shy this is a way of making friends .
 You can treat some special friends you've met like pen pals, but you are chatting instead
of writing letters like they use too 20 years ago .

1.2 MODULES OF PROJECT

1. CHAT SERVER:

The interface has been developed in Swing. Interface has been kept separate from the
network processes. The main components of the server interface are as follows:

1. Messages Area: Connection acceptance , rejection, login messages are shown


here.
2. List of Online Users: On the right side of the message window is the list of
users that are connected to the server currently. A user can be selected from
this list by clicking on name.
3. Configure Server Dialog: This dialog is shown when option is selected from
the menu. This dialog will allow new values and saving to configuration file.
4. Main Menu: The options available for the server . The options includes the
configure server, shutdown server
1
1. CHAT CLIENT:

The interface has been developed in Swing. Interface has been kept separate from the
network processes. The main components of the client interface are as follows

1. Message Tabs: These are the conversation tabs. All conversation windows are
kept within these tabs.
2. Message Entry Field: This is place at the bottom of the window. This is where
the user enters whatever message he/she wants to send. Message is sent by
either pressing enter or pressing the send button. Where the message is sent
depends on which tab is open.
3. Online User List: This list shows all the users who are logged in at the server.
Double clicking on a user will open a conversation window with him .
4. Configure Dialog: This dialog is shown when option is selected from the
menu. This dialog will allow new values and saving to configuration file. You
can change server host name and port.
5. Main Menu: The options available for the server. The options include connect,
disconnect, configure, exit, close current tab, close all tabs, help.

1.3 Tools and Platforms Used

For the development of the project the tools and platforms utilized are:

1. Back End Server


2. Front End Java
3. Operating system Windows 7 Xtreme Edition

2
EXPLANATION OF PROGRAMMING

Client – Server Communication

The server is bound to a fixed socket and listens for connection requests from clients. The clients
try to connect to server on this port and predefined host. Once the communication channels are
set up, both talk in terms of objects defined as protocols. Upon receiving these objects the
program then extracts relevant information and takes appropriate actions. All communications
are through server and may change the protocol parameters if required.

Protocols

Self designed protocols have been defined to enable communications between server and clients.
Protocols have primarily been defined as classed which have required parameters. The objects of
these classes are then exchanged

Message Protocol

This defines how messages are to be handled between users and server. The user
can send public and private message. For private message it is important to know
the recipient and the sender of the message.

Fields

· Audience – public or private message


· RoomNumber – Currently of no use. In future can be used for multiple rooms
· RecieverId – Id of the recipient. Useful only for private messages
· SenderId – Id of sender. Useful only for private messages
· Message – Text that the user wants to send
Client Information Protocol

This is meant to exchange client information between user and server. When a
new client connects to the server its relevant information is kept in an object of
this class. Other users are notified of arrival of new client using information from
this protocol.

3
Fields

· ClientId – Identification number of client within the server.


· ClientName – The login name provided by the user.

Chat Request Protocol

This protocol is used to notify a client that another client wants to start a private
chat with it. A message of this type must be sent before any private conversation
can start. This message is sent when user chooses to start a private conversation.
Upon receiving this request the recipient's client takes steps to receive private
messages from the server by the specified sender.

Fields

· SenderId – The clientId of the client machine that initiated the request.
· RecieverId – The clientId of the client machine that is to be notified.

Update Client List Protocol

When a new user logs in to the server all clients have to be notified of this arrival.
Also when a user logs out, all users must be notified. This protocol is used to
simplify this process. A message of this type with the new clients name is
broadcast to all client machines.

Fields

· Request Type – Indicates if the user has to be added or removed


· ClientName – The name of the client that the information is about

Log Out Protocol

When a user chooses to logout of the system the server and all other users must
be notified. Upon users choice the local client machine sends a message of this
type to the server. Upon receiving this message the server forwards it to all
clients. Then breaks connection with the client.
4

Join Chat Room Protocol

This protocol is reserved for when multiple chart rooms will be implemented.

Fields

· Request Type -- Indicates if the user has to be added or removed


· Room Number – RoomId of the room that the user wants to join

Connection Notice Protocol

If the server rejects the connection then this object is sent to the client. The reason

might be over occupied server or clients nick already in use.


5

INTRODUCTION TO PROGRAMMING ENVIOROMENT

The Java Programming Language:

Java is a programming language originally developed by Sun Microsystems and released in 1995
as a core component of Sun Microsystems Java platform. The language derives much of its
syntax from C and C++ but has a simpler object model and fewer low-level facilities. The major
feature of Java is that it is platform independent. Java applications are typically compiled to
bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. In
the Java programming language, all source code is first written in plain text files ending with the

.java extension. Those source files are then compiled into .class files by the javac compiler. A
.class file does not contain code that is native to your processor. It instead contains bytecodes –
the machine language of the Java Virtual Machine (JVM). The java launcher tool the runs your
application with an instance of the Java Virtual Machine.

Sun released the first public implementation as Java 1.0 in 1995. It promised "Write Once, Run
Anywhere" (WORA), providing no-cost run-times on popular platforms. Fairly secure and
featuring configurable security, it allowed network- and file-access restrictions. Major web
browsers soon incorporated the ability to run secure Java applets within web pages, and Java
quickly became popular. With the advent of Java 2, new versions had multiple configurations
built for different types of platforms.

Primary goals

There were five primary goals in the creation of the Java language:

1. It should use the object-oriented programming methodology.


2. It should allow the same program to be executed on multiple operating systems.
3. It should contain built-in support for using computer networks.
4. It should be designed to execute code from remote sources securely.
5. It should be easy to use by selecting what were considered the good parts of other object-
oriented languages.
6

Java Features

1. Platform Independent : The Write-Once-Run-Anywhere ideal has not been achieved (tuning
for different platforms usually required), but closer than with other languages.

2. Object Oriented : Java is object oriented throughout i.e. there is no coding outside of class
definitions, including main(). There is an extensive class library available in the core language
packages.

3. Robust: Exception handling built-in, strong type checking (that is, all data must be declared an
explicit type), local variables must be initialized.

4. Several Dangerous Features of C and C++ Eliminated: No memory pointers are used. No
preprocessors defined. Array index limit checking.

5. Automatic Memory Management: Automatic garbage collection - memory management


handled by JVM.

6. Security:

 No memory pointers.
 Programs run inside the virtual machine sandbox.
 Array index limit checking

7. Good Performance: Interpretation of byte codes slowed performance in early versions, but
advanced virtual machines with adaptive and just-in-time compilation and other techniques now
typically provide performance up to 50% to 100% the speed of C++ programs.

8. Dynamic Binding: The linking of data and methods to where they are located is done at run-
time. New classes can be loaded while a program is running. Linking is done on the fly. Even if
libraries are recompiled, there is no need to recompile code that uses classes in those libraries.
This differs from C++, which uses static binding. This can result in fragile classes for cases
where linked code is changed and memory pointers then point to the wrong addresses.

9. Threading: Lightweight processes, called threads, can easily be spun off to perform
multiprocessing. We can take advantage of multiprocessors where available. It is great for
multimedia displays.

10. Built-in Networking: Java was designed with networking in mind and comes with many
classes to develop sophisticated Internet communications.

Features such as eliminating memory pointers and by checking array limits greatly help to
remove program bugs. The garbage collector relieves programmers of the big job of memory
management. These and the other features can lead to a big speedup in program development
compared to C/C++ programming.

Java Environment

Java environment includes large number of development tools and hundreds of classes and
methods. The development tools are part of the system known as Java Development Kit (JDK)
and the classes and methods are part of the Java Standard Library (JSL), also known as the
Application Programming Interface (API).

Java swings class hierarchy:

JPanel is Swing's version of the AWT class Panel and uses the same default layout, FlowLayout.
JPanel is descended directly from JComponent.

JFrame is Swing's version of Frame and is descended directly from that class. The components
added to the frame are referred to as its contents; these are managed by the content pane. To add
a component to a JFrame, we must use its content pane instead.

JDialog contains a root pane hierarchy including a content pane, and it allows layered and glass
panes. All dialogs are modal, which means the current thread is blocked until user interaction
with it has been completed. JDialog class is intended as the basis for creating custom dialogs;
however, some of the most common dialogs are provided through static methods in the class
JOptionPane.

JLabel, descended from JComponent, is used to create text labels.

JTextField allows editing of a single line of text. New features include the ability to justify the
text left, right, or center, and to set the text's font.

JPasswordField (a direct subclass of JTextField) you can suppress the display of input. Each
character entered can be replaced by an echo character. This allows confidential input for
passwords, for example. By default, the echo character is the asterisk, *.

JTextArea allows editing of multiple lines of text. JTextArea can be used in conjunction with
class JScrollPane to achieve scrolling. The underlying JScrollPane can be forced to always or
never have either the vertical or horizontal scrollbar.

JButton is a component the user clicks to trigger a specific action.

JRadioButton is similar to JCheckbox, except for the default icon for each class. A set of radio
buttons can be associated as a group in which only one button at a time can be selected.

JCheckBox is not a member of a checkbox group. A checkbox can be selected and deselected,
and it also displays its current state.

JComboBox is like a drop down box. You can click a drop-down arrow and select an option
from a list. For example, when the component has focus, pressing a key that corresponds to the
first character in some entry's name selects that entry. A vertical scrollbar is used for longer lists.

JList provides a scrollable set of items from which one or more may be selected.

FlowLayout when used arranges swing components from left to right until there's no more space
available. Then it begins a new row below it and moves from left to right again. Each component
in a FlowLayout gets as much space as it needs and no more.
BorderLayout places swing components in the North, South, East, West and center of a
container. You can add horizontal and vertical gaps between the areas.

GridLayout is a layout manager that lays out a container's components in a rectangular grid.
The container is divided into equal-sized rectangles, and one component is placed in each
rectangle.

GridBagLayout is a layout manager that lays out a container's components in a grid of cells
with each component occupying one or more cells, called its display area. The display area
aligns components vertically and horizontally, without requiring that the components be of the
same size.

Java awt class hierarchy:

The Java AWT (Abstract Windowing Toolkit) contains the fundamental classes used for
constructing GUIs. The abstract Component class is the base class for the AWT. Many other
AWT classes are derived from it. Button, Canvas, and Container are some AWT classes derived
from Component. The JComponent class is derived from Container and is one of the base classes
of Swing. The JFrame class is derived from the AWT Frame class. It is usually the main
container for a GUI application. The JApplet class (derived from the AWT Applet class) is
sometimes used for Web programming, but the Applet class is more frequently used.

Exception Handling In JAVA

A program can use exceptions to indicate that an error occurred. To throw an exception, use the
throw statement and provide it with an exception object — a descendant of Throwable — to
provide information about the specific error that occurred. A method that throws an uncaught,
checked exception must include a throws clause in its declaration.

A program can catch exceptions by using a combination of the try, catch, and finally blocks. The
try block identifies a block of code in which an exception can occur. The catch block identifies a
block of code, known as an exception handler, can handle a particular type of exception. The
finally block identifies a block of code that is guaranteed to execute, and is the right place to
close files, recover resources, and otherwise clean up after the code enclosed in the try block.
The try statement should contain at least one catch block or a finally block and may have
multiple catch blocks.

The class of the exception object indicates the type of exception thrown. The exception object
can contain further information about the error, including an error message. With exception
chaining, an exception can point to the exception that caused it, which can in turn point to the
exception that caused it, and so on.

JDBC: Java Database Connectivity. Set of programming APIs which allow easy connection to a
wide range of databases through Java programs. A programming interface lets Java applications
access a database via the SQL language. Since Java interpreters (Java Virtual Machines) are
available for all major client platforms this allows a platform-independent database application to
be written. JDBC was the first extension to the Java platform. JDBC is the Java counter Part of
Microsoft’s ODBC. Here we have designed the database in MS-ACCESS.
11

PROJECT ON QUICK MESSENGER “CHAT SERVER”

Quick messenger is a simulation of the instant messenger which we have established within
a LAN. Instant messaging represents a medium via which messaging partners can interact in a
synchronous fashion. Correspondence can occur in a near "instant" manner. With quick
messenger we are providing an easy to use and a rich graphical user interface.
12

SYSTEM DEVELOPMENT LIFE CYCLE

Identification of need
Developing a system is just like a manufacturing unit where some raw material and man power is
used to produce the goods – in computer system, the data are fed to computer for processing.
The result produced in figures by computer is called information and have value of its users. On
the basic of information we can take valuable decisions.

In the later 1980, this process it was known as Computerization, but in 1990s its name is more
popular under the title “Information Technology”. According to an author Peter Norton, the
amount of information we have produced from 1990 to till today is much more than what
information we have produced in last 3000 years. So like industrial revolution, milk revolution
and green revolution – there is a revolution in field of Computers – so that’s why it becomes a
technology called “Information Technology”.

A system is defined as the organized collection of components works in a coordinated


manner, to achieve an objective. There three main implications of a system i.e.

1. A system must have a predetermined objective(s).


2. There must be interrelationship and interdependence among the system components.
3. The objective of organization as whole has higher priority than the objective of an individual
component.

Characteristics of a system:

1. Organization: It means all the parts of a software system must be properly arranged in order
and structure.
2. Interaction: All the components of a system must interact with other components to achieve
the objective.
3. Interdependence: One part of a system must depend upon other component for proper
working. It means the output of one part may be feed to the other component as input.
4. Integration: It means holism; which means the collection of all the components.
5. Central Objective: Each system must have one central objective.
Components of a system

1. Output and input: The output are the outcomes of a system and input are the data, figures
and raw material fed into computer for processing.
2. Processor(s): It is the operational component of a system. In an industry, plant & machinery
is used to convert the incoming material to the finished goods – but in a computer system;
operating system, language & DBMS package helps the user to convert the input data into
output data.
3. Control: It is the decision making subsystem of a system. It deals with management of
resources and other components; Operating system.
4. Feedback: A feedback may be negative or positive. These feedback factors give the idea to
improve the system.
5. Environment: It is the super system in which system operates; like users, offices and labs.
6. Boundaries and interfaces: It is the limit which helps us to identify the system components.

STAGES OF A LIFE CYCLE

Like Nitrogen & Production cycle – a Software system is just like a cycle which passes the
following stages like:

1. Recognition of need.
2. Feasibility study.
3. Analysis.
4. Design.
5. Implementation & Maintenance
1. Recognition of need: This step is to be taken by the authorities of the organization. The old
system has many limitations, which will be discussed in the system analysis part of this project.
The Initial Investigation mainly deals with

 Recognition of need
 Ability of users
 Finance involved
 Current system and how new system will rectify the problems of old one.
 It is also possible that an old or computerized system can be replaced by computerized in
the SAD.

2. Feasibility Study: This study deals with:

Technical Feasibility: It is related with the technical specifications of the projects. It focuses on
the three major questions: Hardware & software available in market

H/W & S/W required Potential of the hardware.

Economics Feasibility: It deals with the cost benefit analysis. It includes the expenses like H/W,
S/W, installation cost, furniture, fixture, wages, salaries etc.

Operational Feasibility: It basically concern with the operational environment capabilities of a


project. It focuses on ability of users, user friendliness of the projects, nature of working
environment provided & ergonomics.

3. Analysis: Analysis is the study of checking the relationship of components with the
environment and other parts of the system. This stages deals with “What is to be done to
design the candidate system?”
4. Design: It is the most creative and challenging phase of system development. It deals with
converting input into output. It contains output design, input design, file or database design
and processing design.
5. Implementation & Maintenance: It is the less creative stage of life cycle in which new
system will replace the old system completely or partially. There are three types of
conversion: Direct, Phase wise and pilot. It also deals with backup, recovery, security and
reliability measures of the cycle.
Preliminary Investigation

Fact finding means to trace the following factors in the field of SYSTEM ANALYSIS AND
DESIGN. The fact finding passes through the following stages.

1. To check the performance of old system.


2. Problems in the old system.
3. Recommendations, which can rectify the problems.
4. The management biases.
5. The user limitations.
6. Present hardware and software.
7. Finance.

Fact-finding is also called feasibility study. SYSTEM ANALYSIS AND DESIGN is just as a
manufacturing unit in which raw material is entered as input, machine and plant work as process
and products/finished goods as output. In the SAD the raw data is the input, program is the
processes and information is output. Some time if the information is not up to the standards then
the output can be fed to the system as input - It means it work as a cycle. So that is why SAD is
also called SDLC i.e. System Development Life Cycle. During the system analysis, it is found
that the old system is the manual system. The old system has following advantages

1. It was very difficult to maintain the bills, complaints register, subscriber’s reports and bulky
bills preparations.
2. No automated tool like COMPUTER is used for the processing.
3. It is difficult to get the prompt case position.
4. Difficult to provide ON-LINE information to the management, customer, clients & subs.
5. More staff was required.
6. Old system has following limitations
 Not up-to-date
 Less security
 Data duplicity
 Not centralized
 Slow in process
Proposed System

 The new recommended is the computerized, which has many advantages over the old
one.
 Since the overall system is under the control of Data Base Administrator (DBA) - hence
the system us centralized one.
 The security and privacy is more in case of new system.
 The long process can be shortened.
 Easy to maintain the reports
 One deletion can delete all the related entries.
 Easy to check the consistency of entries.
 Fast in process as compared to manual system.
Feasibility Study

There are three feasibility studies: Technical, Economic and Behavioral or Operational.
Feasibility is the most successful system projects are not necessarily the biggest or most visible
in a business but rather those that truly meet user expectation.

FEASIBILITY CONSIDERATION:

ECONOMIC FEASIBILITY: Economic analysis is most frequently used method for


evaluating the effectiveness of candidate system. More commonly known as cost and benefit
analysis.

TECHNICAL FEASIBILITY: Technical feasibility centers on the existing computer system


(hardware, software, etc.) and to what extent it can support the proposed addition. For example,
if the current computer is operating at 80% capacity-an arbitrary ceiling- then running another
app. could overload the system or require additional hardware.

BEHAVIORAL FEASIBILITY: People are inherently resistant to change, and computers


have been known to facilitate change. An estimate should be made of how strong a reaction the
user staff is likely to have towards the development of computerized system.
STEPS IN FEASIBILITY ANALYSIS:

1. Form a project team and appoint a project leader

2. Prepare system flowcharts.

3. Enumerate potential candidate system

 Describe and identify characteristics of candidate system


 Determine and evaluate performance and cost effectiveness of each candidate system.
 Weight system performance and cost data.
 Select the best candidate system.
 Prepare and report final project directive to management.
24

DFD OF QUICK MESSENGER “CHAT SYSTEM”


25
E-R DIAGRAM OF QUICK MESSENGER “CHAT SYSTEM”
26

TESTING

In a software project, errors can be introduced at any stage during development. Through errors
are detected after each phase by techniques like inspection, some errors remain undetected.
Ultimately, these remaining errors will be reflected in the code. Hence the final code is likely to
have some requirements errors and design errors, in addition to errors introduced during the
coding activity. Testing is the activity where the errors remaining from all the previous phases
must be detected. Hence, testing performs a very critical role for ensuring quality.

During tasting, the software to be tested is executed with a set of test cases, and the behavior of
the system for the test cases is evaluated to determine if the system is performing as expected.
Clearly, the success of testing in revealing errors depends critically on the test cases.

There are two types of testing:

Black box testing

White box testing


Black box testing

In black box testing the structure of the program is not considered. Test cases are decided
solely on the basis of the requirements or specifications of the program or module, and the
internals of the module or the program are not considered for selection of test classes. In this
section, we will present some techniques for generating test cases for black-box testing. White-
box testing is discussed in the next section.

In black-box testing, the tester only knows the inputs that can be given to the system and
what output the system should give. In other words, the basis for deciding test cases in functional
testing is the requirements or specifications of the system or module. This form of testing
obvious functional or behavioral testing.

The most obvious functional testing procedure is exhaustive testing, which as we have
stated, is empirical. One criterion for generating test causes is to generate them randomly. This
strategy has little chance of resulting in a set of test cases that is close to optimal (i.e. that detects
the maximum errors with minimum test cases). Hence, we need some other criterion or rule for
selecting test cases. There are no formal rules for designing test cases for functional testing. In
fact, there are no precise criteria for selecting test cases. However, there have been found to be
very successful in detecting errors. Here we mention some of these techniques.

White box testing

In the previous section we discussed black-box testing, which is concerned with the
function that the tested program is purposed to perform and does not deal with the internal
structure of the program responsible for actually implementing that function. Those black-box
testing is concerned with functionality rather than implementation of the program. White-box
testing, on the other hand is concerned with testing the implementation of the program. The
intent of this testing is not to exercise all the different input or output conditions ( although that
may be a by-product) but to exercise the different programming structures and date structures
used in the program. White-box testing is also called structure testing, and we will use the two
terms interchangeably. To test the structure of a program, structural testing aims to achieve test
cases that will force the desired coverage of different structures. Various criteria have been
proposed for this. Unlike the criteria for functional testing which are frequently imprecise, the
criteria for structural testing are generally quite precise as they are based on program structures,
which are formal and precise.
28

CONCLUSION

In this project i had tried to cover as much as possible. Many parameters related to online
chatting is kept in mind.

But there is always a scope in improvement of quality. This project will provide a single point
entry for all the clients to message just by mouse clicks.

Information manipulation can be done easily since control is driven by database. This project
will help communication system with various electronic items. So overall i can say that this
project will help a lot to customers of electronic items like computers and mobile.

I conclude that this portal will change the way people communicate. Sending message was never
so easy.

The development of project “Quick messenger” is an original creation. I, as B.Tech student had
tried to increase my experience and knowledge by working in a practical world. The project has
been a rewarding experience in many ways. I had gained as in sight into the working of project
–“QUICK MESSENGER”.
In course of development of this project, I HAD introduced softwares like java. The
project “Quick messenger” is based on communicating Simply by sitting on the terminal.

Finally, I would like to mention that this project has given me an idea of handling real life
situations. I had made my sincerest efforts to complete this work with as much perfection as
possible.

29

FUTURE ENHANCEMENT & SCOPE

1. Login session information: We can include a feature in this application that will keep a
record of the user’s login session.

2. Offline messages: User can send messages to friends even when they are offline.

3. File transferring and sharing: User can transfer one or more files to other users. A file can
also be shared between two or more users.

4. Profile Database: The profile information of every user can be stored at the server.

5. Login Timeout: This feature allows the user to be logged in only for a specific time. After
this time span ends, the user is automatically logged out.

page 30
BIBLIOGRAPHY

1. The Complete Reference JAVA 2 fifth edition

2. Java Cookbook (e-book)

3. JDK 1.6 Documentation

Вам также может понравиться