摘 要 在网络越来越发达的今天,人们对网络的依赖越来越多,越来越离不开网络,由此而产生的聊天工具越来越多,例如,国外的ICQ、国内腾讯公司开发的OICQ。随着网络聊天一类的聊天系统的发展日新月异,因此产生了制作一个类似QQ的网络聊天工具。Java是一种程序设计语言,它具有简单的、完全面向对象以及与平台无关的结构,也具有可移植性、高性能和安全性,并提供了多线程的功能,而Java语言最大的成功之处在于它的平台无关性和具有强大的网络编程功能,基于Java网络编程的强大功能,本人将用Java编写一个网络聊天系统。 论文首先论述了系统的开发背景,并对所用到的开发工具与关键技术做了简单的介绍。接着对系统的研究意义,研究现状及设计目标进行分析,通过对系统需求和可行性进行分析,确定了系统的功能模块,并画出相应的功能结构图、模块图和数据流图。其次按系统总体设计的结果,对系统中的数据库进行结构设计。 一般来说,聊天工具大多数由客户端程序和服务器程序,外加服务器端用于存放客户数据的数据库组成,本系统采用客户机/服务器架构模式,通过Java提供的Socket类来连接客户机和服务器并使客户机和服务器之间相互通信,由于聊天是多点对多点的,而Java提供的多线程功能,用多线程可完成多点对多点的聊天。数据库管理系统用SQLServer2000,完成并通过JDBC-ODBC桥访问数据库。聊天系统完成后将可进行多人对多人的聊天,对好友进行添加、删除,对新用户的注册,发送消息、接受消息,传输文件等功能。界面设计细分化,方便使用者操作和理解。服务器实现了查询和修改等功能,程序逻辑联系较紧密。 关键词:JAVA,C/S,SQL Server 2000, 多线程, 数据库管理系统
ABSTRACT More and more developed in the networktoday, people rely on more and more networks, and can not leave with out it.This caused the chat materials become more numerous, as the overseas ICQsystem, the OICQ system that invented by Tencent Co., and so on. So we create anetwork chat medium just like the QQ.Java is a programming language with thesimple construction which is completely object-oriented 。Java also possess the portability, highperformance and security, and provide the multi – thread function. The bestsuccess is its and its strong network programming function, base on this, Iwill use Java to write a network chat system.
Firstly, the paper discussed thedevelopment background of the system, and made a briefly introduction to thedevelopment tool and key technologies. Then analyzed the system’s researchsignificance , research present situation and project objective .According tothe requirement analysis and feasibility analysis ,it can confirm the system’sfunctional module and draw corresponding functional configuration chart ,modulechart and data stream chart. On the basis of the result of system designing,the paper design database by structured design method. Generally speaking, most chat mediumconsist the client program, server program and the server which is use tocontent the database. This system adopt client/server pattern and the Socketclass provide by Java to communicate the client and server. Because of chat ismany to many, the multithreading function can implement the many-many chat,database management system use SQL Server2000 and JDBC-ODBC bridge to visit thedatabase.
When chat system is achieved, it canpossess functions like chat in a many-many way, add and delete the intimate,the new user’s registration, and sending and receiving message, transferringfiles and so on. Therefinement of interface designing would facilitate user operation andunderstanding. The contact surface has the thin differentiation designs;modules have realized the functions such as inquiry, revision and so on. Thelogic relationship in this program is closed. Keyword: Java, Multithreading, Client/Server, SQL Server2000, Database Management System
|