- 873.50 KB
- 2022-05-17 11:09:39 发布
- 1、本文档共5页,可阅读全部内容。
- 2、本文档内容版权归属内容提供方,所产生的收益全部归内容提供方所有。如果您对本文有版权争议,可选择认领,认领后既往收益都归您。
- 3、本文档由用户上传,本站不保证质量和数量令人满意,可能有诸多瑕疵,付费之前,请仔细先通过免费阅读内容等途径辨别内容交易风险。如存在严重挂羊头卖狗肉之情形,可联系本站下载客服投诉处理。
- 文档侵权举报电话:19940600175。
毕业设计(论文)题目:大学设备管理系统2014年11月20日
太原科技大学毕业设计(论文)任务书学院(直属系):计算机科学与技术系时间:2014年11月4日学生姓名指导教师设计(论文)题目大学设备管理系统主要研究内容1.Java面向对象程序设计2.基于J2EE构架的MIS设计3.基于C/S模式的MVC开发技术研究方法主要进行系统需求分析,数据库分析,编码的设计和实现,最后进行主要功能的测试和运行。主要技术指标(或研究目标)采用系统开发的关键技术基于J2EE构架的MIS设计,基于C/S模式的MVC开发技术,JDBC技术。主要参考文献[1]印旻.Java语言与面向对象程序设计教程.北京:清华大学出版社,2010[2]杨绍方.深入掌握J2EE编程技术.北京:科学出版社,2012[3]戴宗友,张伍荣,杨辉.C#程序设计实训.北京:清华大学出版社,2009.[4]刘甫迎,谢春,徐虹.Java程序设计实用教程.北京:科学出版社,2010[5]孙佳,刘中兵,李伯华.JSP+Oracle动态网站开发实例精选.北京清华大学出版社,2007
大学设备管理系统摘要步入21世纪,计算机在管理信息系统(ManagementInformationSystems,MIS)中应用的普及,利用计算机实现管理信息系统有助于企业或其他用人单位方便实现数据处理、预测功能、计划功能、控制功能和辅助决策功能。MIS是现代用人单位日常工作中必不可缺的一部分,是适应现代管理制度的要求,推动用人单位信息管理走向科学化、规范化的必要条件。在这篇论文中简单介绍了管理信息系统的背景及主要功能。并且以“大学设备管理系统”为例开发了一个简单的MIS系统。由于系统是基于面向对象的开发平台,所以在程序编写过程中多次采用了代码重构技术。后台数据库采用Mysql5.0。本系统使用Java开发,Java程序设计语言是一种优秀的程序设计语言,具有简单、体系结构中立、高性能、可移植性等特点。集成开发环境选用了NetBeans6.5。NetBeans是比较好的javaswing开发平台,可方便的开发基于swing的java系统工程。使用NetBeans进行系统开发,可以方便的生成swing界面,进行可视化设计和布局,或添加页面监听器。关键词:管理信息系统,面向对象技术,Java,大学设备管理II
UniversityEquipmentManagementAbstractWiththehighspeedydevelopmentofelectroniccomputerscience,andthecalculatorisintheManagementInformationSystems,andmakeuseofthecalculatortorealizethebusinessenterprisepersonalmanagementbeimperativeunderthesituation.Thehumanresourcealreadyandgraduallybecomesthemostimportantresourcesofthebusinessenterprises.ManagementInformationSystemsthatmanagethatimportance,manageforhumanresourcethemarketforegroundtoprovidetheamplitude.ItisbetrayedthemainfunctionofManagementInformationSystemsandthebackgroundaswell.Andthe"UniversityEquipmentManagementSystem"developedasimpleMISsystem.Becausethesystemisbasedonobject-orienteddevelopmentplatform,soinprogrammingcodeusedseveraltimesduringthereconstruction.BackgrounddatabaseusingMysql5.0.ThesystemdevelopmentwithJava,Javaprogramminglanguageisanexcellentprogramminglanguage,whichissimple,architectureneutral,highperformance,portabilityandsoon.ChosenintegrateddevelopmentenvironmentEclipse.NetBeansisagoodjavaswingdevelopmentplatform,canbeeasilydevelopedinjavaswingbasedsystemsengineering.SystemsdevelopmentusingNetBeans,youcangenerateswingconvenientinterfaceforvisualdesignandlayout,oraddthelistener.Keywords:managementinformationsystems,OOP,Java,UniversityEquipmentManagementII
目 录摘要IABSTRACTII第一章前言-1-1.1课题研究的目的及意义-1-1.2管理信息系统简介-1-1.3java程序设计语言-2-第二章系统设计-3-2.1需求分析-3-2.1.1系统设计目标-3-2.1.2系统功能分析-3-2.2系统概要设计-3-2.2.1系统模块设计-3-2.2.2系统功能模块图-5-第三章数据库设计与实现-6-3.1数据库概念设计-6-3.2数据库逻辑设计-7-3.3数据库物理实现-7-第四章程序代码结构-9-4.1系统总体架构-9-4.2JDBC数据库连接的封装-9-4.3DBOprate数据库操作和事物的封装-9-4.4对象持久化Dao层-10-4.5UI用户界面层-10-第五章主要功能测试-12-5.1登录模块-12-II
5.2设备信息管理-13-5.3新增设备-14-5.4设备借出-16-5.5设备归还-17-5.6设备报修-19-5.7设备维修-19-5.8学生管理-20-5.9用户个人信息管理-21-5.10后台用户信息管理-22-第六章总结-24-参考文献-25-致谢-26-附录Ⅰ英文资料翻译-27-附录Ⅱ程序代码-39-II
第一章前言1.1课题研究的目的及意义大学设备管理系统是针对在校学生和设备管理员使用,通过管理系统实现对基本信息和日常业务的管理。随着计算机应用的不断深入,各行各业几乎与计算机都有密切的联系,人们的生活已离不开计算机。特别是一些企事业单位,为了适应现代化发展的需要,提高企业的管理水平和办公效率,均以最快的速度引入了计算机,不少企事业单位已经将本单位的计算机连成网络,这样大大加快了企事业单位的办公效率,提高了信息传送的速度。在学校学生设备的管理过程中,发现了一些问题。其中如:新购入的设备没有及时录入,设备借出情况不能跟踪查询。如果仍然通过纸上的方式对设备进行管理,一方面浪费的大量的人力、物力资源,另一方面浪费时间以及在人为的统计过程中不可避免出现的差错等情况。因此,利用管理系统,学生设备管理员只需输入关键信息就可以完成以前几倍的工作量,大幅度增加工作效率,设备的管理也可以进行跟踪管理。1.2管理信息系统简介所谓MIS(管理信息系统--ManagementInformationSystem)系统,是一个由人、计算机及其他外围设备等组成的能进行信息的收集、传递、存贮、加工、维护和使用的系统,是一门新兴的科学,其主要任务是最大限度的利用现代计算机及网络通讯技术加强企业的信息管理,通过对企业拥有的人力、物力、财力、设备、技术等资源的调查了解,建立正确的数据,加工处理并编制成各种信息资料及时提供给管理人员,以便进行正确的决策,不断提高企业的管理水平和经济效益。目前,企业的计算机网络已成为企业进行技术改造及提高企业管理水平的重要手段。MIS系统通常用于系统决策,例如,可以利用MIS系统找出目前迫切需要解决的问题,并将信息及时反馈给上层管理人员,使他们了解当前工作发展的进展或不足。换句话说,MIS系统的最终目的是使管理人员及时了解公司现状,把握将来的发展路径。与传统的管理系统相比,在MIS中,处理的对象是抽象成数据的信息,因此,MIS有着自己的巨大优势:1、解决结构化问题。2、以高速度低成本完成数据的处理业务,追求系统处理问题的效率。3、实现一个相对稳定的、协调的工作环境。4、应用科学的、客观的处理方法,符合实际情况。传统的MIS系统的核心是C/-52-
S(Client/Server——客户端/服务器)架构,而基于Internet的MIS系统的核心是B/S(Browser/Server——浏览器/服务器)架构。B/S架构比起C/S架构有着很大的优越性,传统的MIS系统依赖于专门的操作环境,这意味着操作者的活动空间受到极大限制;而BS架构则不需要专门的操作环境,在任何地方,只要能上网,就能够操作MIS系统。这也就给交互式信息的产生创造了先决条件。使得通过互联网的信息传递更加的便捷。MIS系统的飞速发展,技术的成熟以及应用领域的不断扩大,为网上信息的交互提供了一个良好的平台和方便的操作界面。由于MIS系统基于用户需求的设计方法,使得该系统的使用更加的人性化、个人化、更贴近用户。以MIS系统的构建思想来实现设备统计系统可以最大程度的做到实用性,可扩展性和可维护性相结合,安全性以及规范化原则。1.3java程序设计语言 Java平台由Java虚拟机(JavaVirtualMachine)和Java应用编程接口(ApplicationProgrammingInterface、简称API)构成。Java应用编程接口为Java应用提供了一个独立于操作系统的标准接口,可分为基本部分和扩展部分。在硬件或操作系统平台上安装一个Java平台之后,Java应用程序就可运行。现在Java平台已经嵌入了几乎所有的操作系统。这样Java程序可以只编译一次,就可以在各种系统中运行。Java应用编程接口已经从1.1x版发展到1.2版。目前常用的Java平台基于Java1.5,最近版本为Java1.7。-52-
第二章系统设计2.1需求分析2.1.1系统设计目标·对大学设备进行规范化管理。·支持高效率完成设备信息管理,学生信息管理等。学生信息管理包括添加学生,学生毕业等操作;设备信息管理包括对设备信息信息的录入,借出,归还,报修,维修等操作。·图形化界面,力求界面友好、美观。·软件操作简单,配备详细的说明文档。·软件不受平台限制可以在大部分主流操作系统上使用。2.1.2系统功能分析本系统需要完成的工作如下:·设备各种信息输入,包括设备基本信息和设备借还信息。·学生的各种信息的修改。·对于毕业、退学的学生信息进行修改。·按照某种条件,查询、统计符合条件的设备信息。2.2系统概要设计2.2.1系统模块设计系统主要划分为五个模块:1、设备信息维护:设备的添加大学新进的设别要添加新的商品种类,首先要搜索数据库中是否已经有该类设备,若无则添加,若有则不添加。设备种类的维护,增加,删除在设备种类的修改界面,显示所有的设备种类信息,将搜索得到的全部信息以表格形式在界面输出,选中要删除的记录点击删除;输入新的设备种类信息信息,点击保存,保存信息。2、学生信息的维护:学生的添加学校的新新学生由操作员添加,输入学生的信息,添加学生。会员信息的修改如果学生毕业了,则在学生信息维护界面中把学生的已毕业项设置成已毕业。-52-
学生借出记录查询显示学生借出设备和归还设备记录。3、用户信息维护:增加用户信息在界面表单中填入必要的信息,然后将信息存入数据库。检查填入信息的准确性,弹出错误提示。查询用户信息查询出所有用户信息输入用户的必要信息查出指定用户信息。修改用户信息选定查询结果中要修改的用户信息,将数据出送给弹出的修改界面进行修改,单击确认保存修改内容。删除用户信息在查询结果中选中要删除的用户ID,点击删除时读取用户ID,删除选定的用户。4、设备借出管理:设备借出在设备查询界面选择设备,或手动输入设备号查询设备,点击借出进入设备借出界面,输入学生学号,借出成功,每个学生只能借一个设备设备归还在设备归还界面选择要归还的设备,或者手动输入要归还的设别ID号,点击归还,保存归还信息.5、设备报修管理:设备报修在设备查询界面选择设备报修,或者手动输入设备ID,查询设备,输入损坏情况,点击报修,保存报修信息.设备维修选择查询界面中的已报修未维修的设备点击维修,进入维修界面填写维修解决方案,保存维修信息.-52-
2.2.2系统功能模块图图2.1系统功能模块图-52-
第三章数据库设计与实现数据库是本系统的核心,系统中所有的信息都存储在数据库中,在所有用户界面产生的请求都通过访问相关的Dao层进行数据操作,Dao层通过对JDBC的connection进行封装的工具类进行数据库操作,从而实现相应的功能。数据库软件有很多。本系统中数据库采用Mysql作为DBMS。数据库是软件的核心部分,数据库设计的合理与否对系统的开发有着至关重要的影响。数据库开发的过程一般先是系统分析,再逻辑设计,然后物理实现。在系统分析中分析数据库各用户的需求关系,并画出E-R图直观地表示出数据库系统的需求。逻辑设计中根据系统分析设计出相应的关系模型。物理设计则为逻辑设计中的数据模型选取较合理物理结构,通常选通过数据库软件创建与逻辑设计中数据模型对应的数据库。3.1数据库概念设计本系统的数据库实体主要有“学生”、“设备”、“用户”、“设备种类”等。其中“学生”与“设备”存在“借出”联系,一个学生可以借一个设备,即“学生”与“设备”之间是一对一的关系。“用户”与“设备”存在一对多的关系。一个用户可以报修N个设备,一个设备只能报修一次。“设备”与设备种类指尖存在多对一的关系,即一个设备只能是一个设备种类,一个设备种类可以有多个设备。整个数据库可以用一个E-R图表示,如图:图3.1大学设备管理系统E-R图-52-
3.2数据库逻辑设计数据库逻辑设计就是将E—R图转换为关系模型的过程,即将所有实体和关系转换成一系列的关系模式。转换过程中常见规则有:(1)一个实体型转换为一个关系模式;(2)一个一对一的联系可转换成一个独立的关系模式,也可与任意一端对应的关系模式合并;(3)一个一对多的联系可以转换成一个独立的关系模式,也可与多的那一端对应的关系模式合并;(4)一个多对多的关系转换成一个关系模式。根据以上四条规则,下面将E—R图转换成关系模型。设备(设备ID,设备名称,设备借于,设备损坏)key设备ID学生(学生ID,学生姓名,是否毕业)key学生ID设备借出(借出ID,设备ID,学生ID,借出日期,是否归还,归还日期,管理员ID)key借出ID报修(报修ID,设备ID,随坏情况,报修日期,是否解决,解决方案,解决日期,操作员ID)key报修ID用户(用户ID,用户名,用户密码,用户权限)key用户ID设备种类(种类ID,种类名称)key种类ID3.3数据库物理实现经过数据库系统分析和逻辑设计后,数据库的结构已经非常清晰,剩下的就是用一种数据库软件实现这样的结构。本系统中数据库采用Navicat作为数据库工具。首先在Navicat的数据库连接中创建一个数据库,命名为“lab”,然后通过导入sql文件,新建数据表。sql部分建表语句:--------------------------------Tablestructurefor`device`------------------------------DROPTABLEIFEXISTS`device`;CREATETABLE`device`(`DID`int(11)NOTNULLauto_increment,`KID`int(11)NOTNULL,-52-
`daqian`varchar(30)NOTNULL,`SID`int(11)defaultNULL,`Dbad`varchar(2)NOTNULLdefault"0",PRIMARYKEY(`DID`),KEY`id`(`DID`))ENGINE=InnoDBAUTO_INCREMENT=1DEFAULTCHARSET=utf8;--------------------------------Tablestructurefor`kind`------------------------------DROPTABLEIFEXISTS`kind`;CREATETABLE`kind`(`KID`int(11)NOTNULLauto_increment,`Kname`varchar(30)NOTNULL,PRIMARYKEY(`KID`))ENGINE=InnoDBAUTO_INCREMENT=1DEFAULTCHARSET=utf8;-52-
第四章程序代码结构4.1系统总体架构程序共分为三层,第一层SwingUI层,次层负责与用户交互,收集用户提交的数据,传递给下一层,并将下一层传递过来的数据显示在UI界面上。第二层为Dao数据持久化层,此层封装数据的持久化操作,对用户提交的对象进行持久化操作。UI层通过Dao层取得数据显示在UI界面上,并传递数据给Dao层,让Dao层进行持久化。第三层为JDBC操作和事物管理层,此层封装了JDBC的connection对象的操作,并提供执行sql语句的方法供Dao层调用,对特定的方法,如update,delete,insert启用JDBC事物管理。4.2JDBC数据库连接的封装JDBC的数据库连接对象connection通过ConnectionFactory类进行封装,类内部配置connection连接参数,通过get方法取得connection对象,把数据库连接从持久化层独立出来,一旦数据库变迁,可以通过修改此类中的属性来修改连接参数,从而降低数据库连接模块和数据持久化模块的耦合,达到方便维护的目的维护。关键代码publicstaticConnectiongetConn(){Class.forName(driverName);conection=DriverManager.getConnection(url,user,password);returnconection;}4.3DBOprate数据库操作和事物的封装数据库操作无外乎增删改查,而要进行事物管理的只是曾、改和删操作。所以,在DBOprate类中封装所有数据库的基本操作,对要进行事物管理的操作启动事务管理,把事物和对数据库连接connection对象的操作封装起来,在类内部完成,起到数据库连接和数据持久化层的中间件的作用,并对事物进行管理。关键代码:publicstaticvoidbeatchInsert(Stringsql,intnum)throwsSQLException{-52-
createstmt();conn.setAutoCommit(false);for(intj=0;j<=num;j++){stmt.addBatch(sql);}stmt.executeBatch();conn.commit();conn.setAutoCommit(true);}4.4对象持久化Dao层此层封装了对象的持久化操作,所有对指定对象的操作都定义在此层中。Dao层采用工厂设计模式,结构包括Dao接口、Dao实现类、Dao工厂类。采用工厂设计模式的好处是将Dao实现类的耦合降到最低,当要替换Dao实现类时,只需继承当前Dao实现类,覆盖要修改的方法,或者实现Dao接口,实现所有接口定义的方法。Dao工厂采用单例设计模式,UI层操作的所有Dao对象都是同一个引用,节约系统资源。工厂代码:publicclassDeviceDAOFactory{privatestaticfinalDeviceDAOdeivceDao=newDeviceDAOImp();publicstaticDeviceDAOgetInstance(){returndeivceDao;}}4.5UI用户界面层UI界面按功能模块划分独立Jpane,再由MainView组合成完整的应用程序的方法减少UI模块间的耦合。主页面MainView将它所有要显示的Jpane设为属性公共,并将自己的引用通过Jpane的构造函数传递给各个模块,这样模块之间就可以互相调用方法,传递参数。MainView类构造器代码:publicMainView(Useruser){this.setTitle("实验室设备管理系统");-52-
initComponents();this.user=user;deviceView=newDeviceView(this);loanView=newLoanView(this);repariView=newRepairView(this);studentView=newStudentView(this);userView=newUserView(this);jTabbedPane1.add(deviceView,"设备管理");jTabbedPane1.add(loanView,"设备借出");jTabbedPane1.add(repariView,"设备报修");jTabbedPane1.add(studentView,"学生管理");jTabbedPane1.add(userView,"用户信息修改");}-52-
第五章主要功能测试软件测试是软件开发过程的重要组成部分,是用来确认一个程序的品质或性能是否符合开发之前的需求。软件测试的目的,首先是要确定软件的质量,其中一方面是确认软件做了所期望做的事情,另外一方面是确认软件以正确的方式来做了这个事情。其次是提供信息,例如给开发人员或程序员的反馈信息,为风险评估所准备的信息。最后,软件测试不仅是在测试软件产品的本身,而且还包括软件开发的过程,如果一个软件产品开发完成后出现了很多问题,这说明此软件开发过程很可能是存在缺陷的,因此软件测试的第三个目的是保证软件开发过程是高质量的。5.1登录模块图5.1登陆界面用户输入用户名密码,判断是否正确正确则根据用户权限跳转到相应的页面关键代码如下:Useruser=newUser();user.setUname(jTextField1.getText());user.setUpassw(jPasswordField1.getText());if(jTextField1.getText().equals("")-52-
||jPasswordField1.getText().equals("")){JOptionPane.showMessageDialog(null,"用户名和密码不能为空");return;}UserrightUser=UserDAOFactory.getInstence().checkLogin(user);if(rightUser!=null){if(rightUser.getPermission().equals("普通用户"))newMainView(rightUser).setVisible(true);elsenewAdminView();this.dispose();}elseJOptionPane.showMessageDialog(null,"请输入正确的用户名和密码");其中rightUser根据输入的user信息,进入UserDAO,检索负荷条件的用户信息再将结果反馈给页面,做出相应的响应。5.2设备信息管理图5.2设备信息管理界面-52-
根据用户输入的条件查询出所需要的设备,并对设备信息进行管理。部分查询按钮代码:StringkindName=(String)jComboBox1.getSelectedItem();ListdeviceList=DeviceDAOFactory.getInstance().findByKind(kindName);showDevice(deviceList);根据页面输入的条件,从DeviceDAO中查出相应的数据,调用页面的showDevice方法显示设别信息。新增设备按钮可以跳转到新增界面,添加设备。类别管理按钮会跳转到类别管理界面,进行设别类别的管理。设备报废按钮点击后从当前选定的数据表中的行取出设别ID,调用DeviceDAO中的delete方法,删除设备记录。设备报修按钮会读取当前数据表中选定的设备ID,将ID传入报修界面,节省报修时查找的时间。5.3新增设备图5.3设备增加界面收集用户输入的新设备信息,将信息传递到DeviceDao中做持久化操作。插入方法代码:-52-
intflag=JOptionPane.showConfirmDialog(this,"确认添加");if(flag==2){return;}elseif(flag==0){Devicedevice=newDevice();device.setKid(kindMap.get((String)jComboBox2.getSelectedItem()).getKid());device.setDaqian(jTextField1.getText());DeviceDAOFactory.getInstance().insertDevice(device,jComboBox1.getSelectedIndex());mainView.setVisible(true);this.dispose();}elseif(flag==1){mainView.setVisible(true);this.dispose();}从界面收集要插入的信息,将信息传递到DeviceDAO中,调用insertDevice方法将数据插入数据库。-52-
5.4设备借出图5.4设备借出界面在数据表格中选择设备,单击借出按钮进入借出页面图5.5设备借出登记界面输入借设备的学生学号,如果学生没有借出其他设备则借出成功-52-
图5.6设备借出成功有设备未归还则提示图5.7借出错误信息5.5设备归还图5.8设备归还界面选定表格中的设备或者直接输入设备号查找出要归还的设备-52-
图5.9设备归还确认点击归还设备,完成设备归还操作。图5.10归还成功-52-
5.6设备报修图5.11设备报修界面输入正确的设备号,填写损坏情况,报修设备,设备报修过后无法被借出。5.7设备维修在报修界面选择要维修的报修信息,点击设备维修,填写解决方案,取消设备的报修状态。-52-
图5.12设备维修界面5.8学生管理图5.13学生管理界面此功能模块可以对学生信息进行管理,添加学生,设置学生毕业,查看学生的借出和归还设备记录等等。-52-
图5.14学生借还记录查询5.9用户个人信息管理图5.15用户信息维护界面此功能模块可以进行系统用户的个人信息维护,修改用户密码,返回登录界面等等功能。-52-
5.10后台用户信息管理系统管理员登陆后进入后台界面,可以管理系统的用户信息。添加用户界面图5.16系统用户添加浏览和删除用户界面图5.17系统用户一览从用户一览中选择用户,点击修改按钮,进入修改界面-52-
图5.18用户信息修改此界面可以对选定的用户信息进行修改,可以更改用户密码,权限等操作。-52-
第六章总结经过几个月的学习,研究和开发,我选择的课题大学设备管理系统基本完成。其功能基本符合设备管理使用的要求,能管理设备和学生信息,能借出归还设备,能保修维修设备。由于自己前期设计的考虑不周到,有些地方有少许错误和容错性能比较低,但是还是可以基本完成设备管理系统应有的功能。通过毕业设计过程我会到了许多知识,在实现时我体会到了面向接口编程的好处,Dao设计模式对数据操作封装的好处等等,在设计中我认识到传统软件开发方法是无法再初期将软件的设计考虑周全,因此我进一步的了解到了敏捷开发和快速原型模型的开发方法,在敏捷开发和快速原型模型结合的开发过程中,设计阶段出的成果是一个可以运行的系统原型,这样设计就会有个参照,知道如何去实现需求中的功能。这样就比传统软件开发过程更合理,也更节约人力,把反攻次数减少到最低。通过毕业设计,我体会到了我们所学的知识只是处于理论阶段,只有经过实际应用过后,才能真正的掌握知识。只有将我们所学的软件工程知识,程序编写的知识真正应用于实际开发,我们才能更好的理解和掌握学校教给我们的知识。-52-
参考文献[1]印旻.Java语言与面向对象程序设计教程.北京:清华大学出版社,2010[2]杨绍方.深入掌握J2EE编程技术.北京:科学出版社,2012[3]戴宗友,张伍荣,杨辉.C#程序设计实训.北京:清华大学出版社,2009.[4]刘甫迎,谢春,徐虹.Java程序设计实用教程.北京:科学出版社,2010[5]孙佳,刘中兵,李伯华.JSP+Oracle动态网站开发实例精选.北京清华大学出版社,2007[6]科夫勒.SQLServer权威指南.北京:人民邮电出版社,2007[7]余冬梅,张秋余,林常须,等.基于J2EE支持多客户端的MVC设计模式研究[J].计算机工程与设计,2005[8]高海茹.SQLServer网络数据库技术精粹.北京:机械工业出版社,2002[9]徐敏奎.管理信息系统.北京:中国标准出版社,2011[10]王冰.JSP+Oracle网站开发实例精讲.北京:人民邮电出版社,2007[11]冯若曼.ThinkingInJava第四版中文版.2010-52-
致谢经过近几个月的努力,我的毕业论文终于接近了尾声。在短短的几个月内,我的毕业设计能够顺利完成,从很大程度上,得益于我的指导老师的悉心指导和亲朋好友的鼓励与赞同。在此,我向他们表示我最诚挚的敬意和最衷心的感谢!在毕业设计过程中,指导老师的给了我大力支持和帮助,使得设计过程中所遇到的许多问题得以解决,并且使我能够在解决问题的同时,很好地掌握了所用相关领域的知识以及自主思考、解决问题的方法,同时掌握了进行课题研究时将所用的方法、模式和具体实现手段相结合的技巧,充分地将所学理论应用于毕业设计的实践过程当中,使我独立分析、解决问题的能力得以提高。在设计完成的过程中,我还得到了许多同学的热情帮助,在此表示感谢!最后,再次感谢对我的帮助,并向所有帮助过我的人致以最诚挚的谢意!-52-
附录Ⅰ英文资料翻译InformationSystemDevelopmentandDatabaseDevelopmentInmanyorganizations,databasedevelopmentfromthebeginningofenterprisedatamodeling,datamodelingenterprisesdeterminethescopeofthedatabaseandthegeneralcontent.Thisstepusuallyoccursinanorganization"sinformationsystemplanningprocess,itaimstohelporganizationscreateanoveralldatadescriptionorexplanation,andnotthedesignofaspecificdatabase.Aspecificdatabaseforoneormoreinformationsystemsprovidedataandthecorporatedatamodel(whichmayinvolveanumberofdatabases)describedbytheorganizationmaintainingthescopeofthedata.Datamodelingintheenterprise,youreviewofthecurrentsystem,theneedtosupportanalysisofthenatureofthebusinessareas,theneedforfurtherdescriptionoftheabstractdata,andplanningoneormoredatabasedevelopmentproject.Figure1showsPineValleyfurniturecompany"senterprisedatamodelofapart.1.1InformationSystemArchitectureAsshowninfigure1,seniordatamodelisonlygeneralinformationsystemarchitecture(ISA)orapartofanorganization"sinformationsystemblueprint.Intheinformationsystemplanning,youcanbuildanenterprisedatamodelasawholeinformationsystemarchitecturepart.AccordingtoZachman(1987),SowaandZachman(1992)viewsofaninformationsystemarchitectureconsistsofthefollowingsixkeycomponents:Data(Figure1shows,butthereareothermethodsthat).Manipulationofdataprocessing(ofadataflowdiagramcanbeused,withtheobjectmodelmethods,orothersymbolsthat).Networks,whichorganizationsandinorganizationswithitsmaintransmissionofdatabetweenbusinesspartners(itcanconnectthroughthenetworktopologymapandtodemonstrate).Peoplewhodealwiththeimplementationofdataandinformationandisthesourceandreceiver(intheprocessmodelforthedatashowsthatthesenderandthereceiver).Implementationoftheeventsandtimepoints(theycanusestatetransitiondiagramandothermeans.)Thereasonsfortheincidentanddataprocessingrules(oftenintheformoftextdisplay,buttherearealsoanumberofchartsfortheplanningtoolssuchasdecisiontables).1.2InformationEngineeringInformationsystemsplannersinaccordancewiththespecificinformationsystemplanningmethodsdevelopedinformationsystemarchitecture.Informationengineeringisapopularandformalmethods.Informationengineeringisadata-orientedcreationandmaintenanceoftheinformationsystem.Informationengineeringisbecausethedata-oriented,sowhenyoubegintounderstandhowthedatabaseisdefinedbythelogoandwheninformationengineeringaconciseexplanationisveryhelpful.InformationEngineeringfollowtop-downplanningapproach,inwhichspecificinformationsystemsfromawiderangeofinformationneedsintheunderstandingderivedfrom(forexample,weneedaboutcustomers,products,suppliers,salesandprocessingofthedatacenter),ratherthanmergingmanydetailedinformationrequested(orderssuchasascreenorinaccordancewiththeimportationofgeographicalsalessummaryreport).Top-downplanningwillenabledeveloperstoplanmorecomprehensiveinformationsystem,considersystemcomponentsprovideanintegratedapproachtoenhancetheinformationsystemandtherelationshipbetweenthebusinessobjectivesoftheunderstanding,deepentheirunderstandingofinformationsystemsthroughouttheorganizationinunderstandingtheimpact.InformationEngineeringincludesfoursteps:planning,analysis,designandimplementation.Theplanningstageofprojectinformationgeneratedinformationsystemarchitecture,includingenterprisedatamodel.1.3InformationSystemPlanningInformationsystemsplanningobjectiveistoenableITorganizationsandthebusinessstrategycloselyintegrated,suchintegrationfortheinformationsystemsandtechnologytomakethemostoftheinvestmentinterestisveryimportant.Asthetableasadescription,informationengineeringapproachtheplanningstageincludethreesteps,weinthefollow-upofthreesectionstheydiscussed.1.CriticalfactorsdeterminingtheplanningPlanningisthekeyfactorthatorganizationalobjectives,criticalsuccessfactorsandproblemareas.Thesefactorsdeterminethepurposeoftheestablishmentofplanningandenvironmentplanningandinformationsystemslinkedtostrategicbusinessplanning.Table2showsthePineValleyfurniturecompany"skeyplanninganumberofpossiblefactors,thesefactorscontributetotheinformationsystemsmanagerforthenewinformationsystemsanddatabasesclubstopprioritytodealwiththedemand.Forexample,giventheimprecisesalesforecaststhisproblemareas,informationsystemsmanagersintheorganizationmaybestoredinthedatabaseadditionalhistoricalsalesdata,newmarketresearchdataandnewproducttestdata.2.Theplanningorganizationssettargets-52-
Organizationsplanningtargetsdefinedscopeofbusiness,andbusinessscopewilllimitthesubsequentanalysisandinformationsystemsmaychangeplaces.Fivekeyplanningtargetsasfollows:●organizationalunitsinthevarioussectors.●organizationslocationoftheplaceofbusinessoperations.●functionsofthebusinesssupportorganizationshandlingmissionoftherelevantgroup.Unlikebusinessorganizationsfunctionmodules,infactafunctioncanbeassignedtovariousorganizationsmodules(forexample,productdevelopmentfunctionistheproductionandsaleofthecommonresponsibilityoftheMinistry).●typesofentitiesmanagedbytheorganizationonthepeople,placesandthingsofthemajortypesofdata.●InformationSystemdatasetprocessingsoftwareapplicationsandsupportprocedures.3.TosetupabusinessmodelAcomprehensivebusinessmodelincludingthefunctionsofeachenterprisefunctionaldecompositionmodel,theenterprisedatamodelandthevariousplanningmatrix.Functionaldecompositionisthefunctionoftheorganizationforamoredetaileddecompositionprocess,thefunctionaldecompositionistosimplifytheanalysisoftheissue,distractedandidentifycomponentsandtheuseoftheclassicalapproach.PineValleyfurniturecompanyinordertofunctioninthefunctionaldecompositionexampleinfigure2below.Indealingwithbusinessfunctionsandsupportfunctionsofthefullset,multipledatabases,isessentialtoaspecificdatabasethereforelikelyonlytosupportfunctions(asshowninFigure2)provideasubsetofsupport.Inordertoreducedataredundancyandtomakedatamoremeaningful,hasacomplete,high-levelbusinessviewisveryhelpful.Theuseofspecificenterprisedatamodeltodescribethesymbol.Apartfromthegraphicaldescriptionofthistypeofentity,acompleteenterprisedatamodelshouldalsoincludeadescriptionofeachentitytypedescriptionofbusinessoperationsandasummaryofthatbusinessrules.Businessrulesdeterminethevalidityofthedata.Anenterprisedatamodelincludesnotonlythetypesofentities,includingthelinkbetweenthedataentities,aswellasvariousotherobjectsplanninglinks.Showedthatthelinkagebetweenplanningtargetsacommonformofmatrix.Becauseofplanningmatrixneednotbeexplicitmodelingdatabasecanbeclearlydescribedbusinessneeds,planningmatrixisanimportantfunction.Regularplanningmatrixderivedfromtheoperationalrules,itwillhelpsocialdevelopmentactivitiesthattopprioritywillbesortinganddevelopmentactivitiesunderthetop-downviewthroughanenterprise-wideapproachforthedevelopmentoftheseactivities.Therearemanytypesofplanningmatrixisavailable,theircommonalitiesare:●locations-featuresshowbusinessfunctioninwhichtheimplementationofoperationallocations.●unit-functionswhichshowedthatbusinessfunctionorbusinessunitresponsibleforimplementation.●InformationSystem-dataentitiestoexplainhoweachinformationsysteminteractwitheachdataentity(forexample,whetherornoteachsystemineachentityhavethedatatocreate,retrieve,updateanddelete).●supportfunctions-dataineachfunctionalentitiesinthedatasetfortheacquisition,use,updateanddelete.●InformationSystem-targetindicationforeachinformationsystemtosupportbusinessobjectives.Figure3illustrateapossiblefunctions-dataentitiesmatrix.Suchamatrixcanbeusedforavarietyofpurposes,includingthefollowingthreeobjectives:1)identifygapsinthedataentitiestoindicatethetypesofentitiesnotuseanyfunctionorfunctionswhichdonotuseanyentity.2)foundthatthelossofeachfunctionalentitiesinvolvedintheinspectionstaffthroughthematrixtoidentifyanypossiblelossoftheentity.3)Thedistinctionbetweendevelopmentactivitiesiftheprioritytothetopofasystemdevelopmentfunctionforahigh-priority(probablybecauseitimportantorganizationalobjectivesrelated),thenthisareausedbyentitiesinthedevelopmentofthedatabasehasahighpriority.Hoffer,GeorgeandValacich(2002)aretheworksofthematrixonhowtousetheplanningandcompletionoftheInformationEngineeringTheplanningsystemmorecompletedescription.2databasedevelopmentprocessBasedoninformationengineeringinformationsystemsplanningdatabaseisasourceofdevelopmentprojects.Thesenewdatabasedevelopmentprojectsisusuallyinordertomeetthestrategicneedsoforganizations,suchasimprovingcustomersupport,improveproductandinventorymanagement,oramoreaccuratesalesforecast.However,manymoredatabasedevelopmentprojectisthebottom-upapproachemerging,suchasinformationsystemuserneedsspecificinformationtocompletetheirwork,thusbeginninga-52-
projectrequest,andasotherinformationsystemsexpertsfoundthatorganizationsneedtoimprovedatamanagementandbeginnewprojects.Bottom-upeveninthecircumstances,tosetupanenterprisedatamodelisalsonecessarytounderstandtheexistingdatabasecanprovidethenecessarydata,otherwise,thenewdatabase,dataentitiesandattributescanbeaddedtothecurrentdataresourcestotheorganization.Boththestrategicneedsoroperationalinformationneedsofeachdatabasedevelopmentprojectsnormallyconcentratedinadatabase.Someprojectsonlyconcentratedinthedatabasedefinition,designandimplementationofadatabase,asafollow-uptothebasisofthedevelopmentofinformationsystems.However,inmostcases,thedatabaseandassociatedinformationprocessingfunctionasacompleteinformationsystemsdevelopmentprojectwaspartofthedevelopment.2.1SystemDevelopmentLifeCycleGuidemanagementinformationsystemdevelopmentprojectsisthetraditionalprocessofsystemdevelopmentlifecycle(SDLC).SystemdevelopmentlifecycleisanorganizationofthedatabasedesignersandprogrammersinformationsystemcomposedofthePanelofExpertsdetaileddescription,development,maintenanceandreplacementoftheentireinformationsystemsteps.ThisprocessisbecauseWaterfallthanforeverystepintotheadjacentthenextstep,thatis,theinformationsystemisaspecificationdevelopedbyapieceofland,everypieceoftheoutputisunderaninput.Howevershowninthefigure,thesestepsarenotpurelylinear,eachofthestepsoverlapintime(andthuscanmanageparallelsteps),butwhentheneedtoreconsiderpreviousdecisions,butalsotorollbacksomestepsahead.(Andthereforewatercanbeputbackinthewaterfall!)Figure4onthesystemdevelopmentlifecycleandthepurposeofeachstageoftheproductcanbedeliveredconcisenotes.Thesystemdevelopmentlifecycleincludingeachstageanddatabasedevelopment-relatedactivities,therefore,thequestionofdatabasemanagementsystemsthroughouttheentiredevelopmentprocess.InFigure5werepeatofthesystemdevelopmentlifecyclestageoftheseven,andoutlinesthecommondatabaseateachstageofdevelopmentactivities.Pleasenotethatthesystemsdevelopmentlifecyclestagesanddatabasedevelopmentsteps一一对应existsbetweentherelationshipbetweentheconceptofmodelingdatainbothsystemsdevelopmentlifecyclestagesbetween.EnterpriseModelingDatabasedevelopmentprocessfromtheenterprisemodeling(systemdevelopmentlifecyclestageoftheprojectfeasibilitystudies,andtochooseapart),Organizationssetthescopeandgeneraldatabasecontent.Enterprisemodelingininformationsystemsplanningandotheractivities,theseactivitiesdeterminewhichpartofinformationsystemsneedtochangeandstrengthentheentireorganizationandoutlinesthescopeofdata.Inthisstep,checkthecurrentdatabaseandinformationsystems,developmentoftheprojectasthemainareasofthenatureofthebusiness,withaverygeneraldescriptionofeachterminthedevelopmentofinformationsystemswhenneededdata.Eachitemonlywhenitachievedtheexpectedgoalsoforganizationscanbewhenthenextstep.ConceptualDataModelingOnehasalreadybegunontheInformationSystemproject,theconceptofdatamodelingphaseoftheinformationsystemsneedsofallthedata.Itisdividedintotwostages.First,itbegantheprojectintheplanningstageandtheestablishmentofaplansimilartoFigure1.Atthesametimeoutliningtheestablishmentofotherdocumentstotheexistingdatabasewithoutconsideringthecircumstancesspecificdevelopmentprojectsinthescopeoftherequireddata.Thiscategoryonlyincludeshigh-leveldata(entities),andmaincontact.Theninthesystemdevelopmentlife-cycleanalysisstagemusthaveamanagementinformationsystemsettheentireorganizationDetailsofthedatamodeldefinitionofalldataattributes,listingalldatatypesthatalldatainter-entitybusinesslinkages,definingdescriptionofthefulldataintegrityrules.Intheanalysisphase,butalsotheconceptofinspectiondatamodel(alsocalledtheconceptbehindthemodel)andthegoalofinformationsystemsusedtoexplainotheraspectsofthemodelofconsistencycategories,suchasprocessingsteps,rulesanddataprocessingtimeoftiming.However,eveniftheconceptissuchdetaileddatamodelisonlypreliminary,becausefollow-upinformationsystemlifecycleactivitiesinthedesignofservices,statements,displayandinquiriesmayfindthatmissingelementormistakes.Therefore,theconceptofdataoftensaidthatmodelingisatop-downmanner,itsareasofoperationfromthegeneralunderstandingofthedriver,ratherthanthespecificinformationprocessingactivitiesbythedriver.3.LogicalDatabaseDesignLogicaldatabasedesignfromtwoperspectivesdatabasedevelopment.First,theconceptofdatamodeltransformintorelationaldatabasetheorybasedonthecriteriathatmeans-between.Then,asthedesignofinformationsystems,everycomputerprocedures(includingproceduresfortheinputandoutputformat),databasesupportservices,statements,andinquiriesrevealedthatadetailedexamination.Inthisso-calledBottom-upanalysis,accurateverificationoftheneedtomaintainthedatabaseandthedataineachaffairs,statementsandsoontheneedsofthoseinthenatureofthedata.-52-
Foreachseparatestatements,services,andsoontheanalysismusttakeintoaccountaspecific,limitedbutcompletedatabaseview.Whenstatements,services,andotheranalysismightbenecessarytochangetheconceptofdatamodel.Especiallyinlarge-scaleprojects,thedifferentanalyticalsystemsdevelopmentstaffandtheteamcanworkindependentlyindifferentproceduresorinacentralized,thedetailsoftheirworkuntilallthelogicdesignstagemaybedisplayed.Inthesecircumstances,logicdatabasedesignstagemustbetheoriginalconceptofdatamodelanduserviewtheseindependentormergedintoacomprehensivedesign.Inlogicdesigninformationsystemsalsoidentifyadditionalinformationprocessingneedsofthesenewdemandsatthistimemustbeintegratedintothelogicofearlieridentifiedinthedatabasedesign.Logicaldatabasedesignisbasedonthefinalstepfortheformationofgooddataspecificationsanddeterminetherules,thecombination,thedataafterconsultationspecificationsorconvertedintobasicatomicelement.Mostoftoday"sdatabase,theserulesfromtherelationaldatabasetheoryandtheprocessknownasstandardization.Thisstepistheresultofmanagementofthesedatahavenotcitedanydatabasemanagementsystemforacompletedescriptionofthedatabasemap.Logicaldatabasedesigncompleted,webegantoidentifyindetailthelogicofthecomputerprogramandmaintenance,thereportcontentsofthedatabaseforinquiries.4.PhysicaldatabasedesignanddefinitionPhysicaldatabasedesignanddefinitionphasedecisionscomputermemory(usuallydisk)databaseintheorganization,definitionofAccordingtothelibrarymanagementsystemforphysicalstructure,theproceduresoutlinedprocessingservices,producethedesiredmanagementinformationanddecisionsupportstatements.Theobjectiveofthisstageistodesignaneffectiveandsafemanagementofalldata-processingdatabase,thephysicaldatabasedesigntocloselyintegratetheinformationsystemsofotherphysicalaspectsofthedesign,includingprocedures,computerhardware,operatingsystemsanddatacommunicationsnetworks.5.DatabaseImplementationThedatabasepreparedbytherealizationstage,testingandinstallationproceduresforhandlingdatabases.Designerscanusethestandardprogramminglanguage(suchasCOBOL,CorVisualBasic),thededicateddatabaseprocessinglanguages(suchasSQL),ortheprocessofthenon-exclusivelanguageprogramminginordertoproduceastatementofthefixedformat,theresultwillbedisplayed,andmayalsoincludecharts.Inachievingstage,butalsothecompletionofallthedatabasefiles,trainingusersforinformationsystems(database)usersetupprogram.Thefinalstepistouseexistingsourcesofinformation(documentslegacyapplicationsanddatabasesandnowneedsnewdata)loadingdata.Loadingdataisoftenthefirststepindatafromexistingfilesanddatabasestoanintermediateformat(suchasbinaryortextfiles)andthentoturnintermediateloadingdatatoanewdatabase.Finally,runningdatabasesandrelatedapplicationsfortheactualusermaintenanceandretrievalofdata.Inoperation,theregularbackupdatabaseandthedatabasewhendamagedoraffectedresumedatabase.6.DatabasemaintenanceDuringthedatabaseintheprogressivedevelopmentofdatabasemaintenance.Inthisstep,inordertomeetchangingbusinessconditions,inordertocorrecttheerroneousdatabasedesign,databaseapplicationsorprocessingspeedincrease,deleteorchangethestructureofthedatabase.Whenaprocedureorfailureofthecomputerdatabaseaffectordamagethedatabasemayalsobereconstruction.Thisstepusuallyisthelongestinthedatabasedevelopmentprocessstep,asitcontinuedtodatabasesandrelatedapplicationsthroughoutthelifecycle,thedevelopmentofeachdatabasecanbeseenasabriefdatabasedevelopmentprocessanddatamodelingconceptsarise,logicalandphysicaldatabasedesignanddatabasetoachievedealingwiththechanges.2.2InformationSystemdevelopedbyothermeansSystemDevelopmentLifeCycleminorchangesinlaworitsvariantoftheoftenusedtoguideinformationsystemsanddatabasedevelopment.InformationSystemisalife-cyclemethodology,itishighlystructuredapproach,whichincludesmanychecksandbalancestoensurethateverystepofproduceaccurateresults,andneworalternativeinformationsystemanditmustcommunicationsordatadefinitionsconsistentexistingsystemneedsconsistency.Systemdevelopmentlifecyclebecauseoftheregularneedtohaveaworkingsystemforalongtimebeencriticizedbecauseonlyworkinthesystemuntiltheendofthewholeprocessgenerated.Moreandmoreorganizationsnowuserapidapplicationdevelopmentmethod,itisaincludesanalysis,designandimplementationofstepstorepeattherapiditerativeprocessuntilconvergencetousersthesystemsofar.RapidApplicationDevelopmentActrequiredthedatabasehasbeeninexistence,andenhancesystemismainlytotheapplicationofdataretrievalapplication,butnottothosewhogenerateandmodifydatabaseapplications.Themostwidelyusedmethodofrapidapplicationdevelopmentisoneoftheprototype.Theprototypesystemisamethodofiterativedevelopmentprocess,analystsandusersthroughcloseco-operation,continuingtorevisethesystemwilleventuallyconvertalltheneedsofaworkingsystem.Figure6showsprototypeoftheprocess.Inthisdiagramwecontainsnotes,brieflydescribeseachstageoftheprototypeofthedatabase-52-
developmentactivities.Normally,wheninformationsystemsproblemswereidentified,triedonlyaroughconceptofdatamodeling.Inthedevelopmentoftheinitialprototype,thedesignoftheuserwantstodisplayandstatements,andthatanynewdatabaseneedsanddefineatermprototypedatabase.Thisisusuallyanewdatabase,copythepartoftheexistingsystem,butmightalsoaddedsomenewcontent.Whentheneedfornewcontent,theseelementsareusuallyfromexternaldatasources,suchasmarketresearchdata,thegeneraleconomicindicatorsorindustrystandards.Whenaprototypeofanewversiontorepeattheachievementandmaintenanceofdatabaseactivities.Usuallyonlyaminimumlevelofsecurityandintegritycontrol,becauseatthistimethefocusisassoonaspossibletoproduceaprototypeversioncanbeused.Butdocumentmanagementprojectalsodeferredtothefinal,onlybeusedinthedeliveryofusertraining.Finally,onceconstructedanacceptableprototype,developers,anduserswillbethefinaldecisionofwhethertoprototypedeliveryandtheuseofthedatabase.Ifthesystem(includingdatabase)efficiencyisverylow,thenthesystemanddatabasewillbere-programmingandre-organizationinordertoachievethedesiredperformance.Alongwithvisualprogrammingtools(suchasVisualBasic,Java,VisualC++andfourthgenerationlanguage)increasinglypopularuseofvisualprogrammingtoolscaneasilychangetheuserinterfacewiththesystem,theprototypeisbecomingthechoiceofsystemdevelopmentmethodology.Customersusingtheprototypemethodstatementsandshowchangestothecontentandlayoutisquiteeasy.Intheprocess,thenewdatabaseneedswereidentified,soitisthedevelopmentoftheuseoftheexistingdatabaseshouldbeamended.Thereiseventhepossibilityofaneedforanewdatabasesystemprototypemethod,insuchcircumstances,whenthesystemdemandintheiterativeprocessofdevelopmentintheever-changingneedsaccesstosampledata,theconstructionorreconstructionofthedatabaseprototype.3databasedevelopmentofthethree-tierarchitecturemodelInthisarticleonthefrontofthedatabasedevelopmentprocessmentionedintheinterpretationofasystemdevelopmentprojectontheestablishmentoftheseveraldifferent,butrelateddatabaseviewormodel:●conceptualmodel(intheanalysisstageoftheestablishment).●externalmodeloruserview(intheanalysisphaseandtheestablishmentoflogicaldesignphase).●physicalmodelorinternalmodel(inthephysicaldesignphaseoftheestablishment).Figure7describesthedatabaseviewthattherelationshipbetweenthethree,itisimportanttorememberthattheyarethesameorganizationsdatabaseviewormodel.Inotherwords,eachorganizationhasadatabaseofthephysicalmodel,aconceptmodelandoneormoreusersview.Therefore,thethree-tierarchitecturemodelusingthesamedatasetobservethedifferentwaysdefinitiondatabase.Conceptmodelsonthefulldatabasestructure,hasnothingtodowiththetechnicalspecifications.Conceptualmodeldefinitiondonotinvolvetheentiredatabasedatastoredinthecomputerhowthesecondarymemory.Usually,theconceptualmodelbyentities-links(E-R)maporobjectmodelingsymbolssuchagraphicalformattodescribe,wehavethistypeofconceptmodelcalledthedatamodel.Inaddition,theconceptualmodelspecificationasametadatastoredinthedatabaseordatadictionary.Physicalmodelsincludingconceptualmodelofhowdatastoredincomputermemoryinthetwospecifications.Analystsandthedatabasedesignisasimportanttothephysicaldatabase(physicalmode)definition,itprovidesinformationonthedistributionandmanagementofdatastorageandaccessofthephysicalmemoryspaceoftwofulldatabasetechnologyspecifications.Databasedevelopmentanddatabasetechnologydatabaseisamongthethreemodelsdividedintobasis.Databasedevelopmentprojectsmayhavearoletoonlydealwiththesethreeviewsofarelatedwork.Forexample,abeginnermaybedesignedforoneormoreproceduresexternalmodel,andanexperienceddeveloperwilldesignthephysicalmodelorconceptualmodel.Databasedesignissuesatdifferentlevelsarequitedifferent.4three-tierstructureofthedatabasepositioningsystemObviously,allthegoodthingsinthedatabaseare,andthe"three"!Whendesigningadatabase,youhavetochoosewheretostoredata.Thisoptioninthephysicaldatabasedesignstage.Databaseisdividedintoindividualdatabases,theWorkingGroupdatabase,departmentaldatabases,corporatedatabasesandtheInternetdatabase.Individualsoftenbytheend-userdatabasedesignanddevelopmentoftheirown,justbydatabaseexpertstogivetrainingandadvicetohelp,itonlycontainsindividualend-usersinterestedinthedata.Sometimes,personaldatabasefromthedatabaseorenterpriseWorkingGroupextractedfromthedatabase,suchcircumstancesdatabasepreparedbysomeexpertsfromtheregularroutinetocreatelocaldatabase.SectorWorkingGroupdatabaseandthedatabaseisoftentheend-user,businessexpertsandthecentraldatabasesystemexpertsdevelopment.Thecollaborativeworkoftheseofficersisnecessarybecauseinthedesignofthedatabasetobesharedbyalargenumberofissuesweigh:processingspeed,easeofuse,datadefinitiondifferencesandothersimilarproblems.DuetocorporatedatabasesandtheInternetdatabasebroadimpact,large-scale,itisnormallyconcentratedinthedatabasedevelopmentteamhas-52-
receivedprofessionaltrainingtodevelopadatabaseofexperts.1.CustomerslayerAdesktopornotebookalsoknownasthatlayer,whichspecializedmanagementuserinterfaceandsystemlocalizationdatainthislayercanbeimplementedontheWebscriptingtasks.2.Server/WebserverHTTPprotocolhandling,scriptingtasks,theimplementationofcomputingandprovidedataaccess,thelayerknownasprocessingserviceslayer.3.EnterpriseServer(Minicomputerormainframe)layerTheimplementationofcomplexcomputingandinter-organizationalmanagementfrommultipledatasourcesofdataintegration,alsoknownasdataserviceslayer.Inanorganization,hierarchicaldatabaseandinformationsystemarchitecturefordistributedcomputingandtheclient/serverarchitectureoftheconceptofcorrelation.Client/serverarchitecturebasedonaLANenvironment,includingservers(referredtoasdatabaseserverordatabaseengine)databasesoftwareimplementationfromtheclientworkstationdatabaseorders,eachcustomerapplicationsfocusontheiruserinterfacefunctions.Infact,thewholeconceptofthedatabase(aswellastheapplicationofthesedatabasestohandleroutine)asadistributeddatabaseortheseparatebutrelatedphysicaldatabasedistributioninthelocalPCworkstation,serverintermediate(workinggrouporsector)andonecenterserver(departmentsorenterprises).Simplysaidthattheuseofclient/serverarchitecturefor:●itcanhandlemultipleprocessorsonthesameapplicationatthesametime,improveapplicationresponsetimeanddataprocessingspeed.●Itcanuseeachcomputerplatformofthebestdataprocessing(suchasPCMinicomAdvanceduserinterfacewiththemainframeandcomputingspeed).●canmixvariousclienttechnology(IntelorMotorolaprocessorassemblyofpersonalcomputers,computernetworks,informationkiosks,etc.)andpublicdatasharing.Inaddition,youcanchangethetechnologyatanylayerandotherlayersonlyasmallinfluenceonthesystemmodule.●abletohandleclosetothedatasourcetobeaddressedtoimproveresponsetimeandreducenetworktraffic.●acceptittoallowandencourageopensystemsstandards.Fordatabasedevelopment,theuseofamulti-layeredclient/serverdatabasearchitecturedevelopmentisthemostmeaningfulofthedatabasewillbeeasytodevelopandmaintaindatabasemoduletotheend-userandthatthecontentsofthedatabaseinformationsystemmoduleseparated.ThatroutinecanbeusedasPowerBuilder,Java,andVisualBasiclanguagetoprovidethiseasy-to-usegraphicaluserinterface.Throughmiddlewarethatroutineinteractionbetweenlayerscanbepassedtoaccessroutine,theroutinevisittothenecessarydataandanalysisofthesedatainordertoformtherequiredinformation.Asadatabasedevelopersandprogrammers,youcaninthisthree-tierlevelofanyofthework,developingthenecessarysoftware.-52-
信息系统开发和数据库开发在许多组织中,数据库开发是从企业数据建模开始的,企业数据建模确定了组织数据库的范围和一般内容。这一步骤通常发生在一个组织进行信息系统规划的过程中,它的目的是为组织数据创建一个整体的描述或解释,而不是设计一个特定的数据库。一个特定的数据库为一个或多个信息系统提供数据,而企业数据模型(可能包含许多数据库)描述了由组织维护的数据的范围。在企业数据建模时,你审查当前的系统,分析需要支持的业务领域的本质,描述需要进一步抽象的数据,并且规划一个或多个数据库开发项目。图1显示松谷家具公司的企业数据模型的一个部分。1.1信息系统体系结构如图1所示,高级的数据模型仅仅是总体信息系统体系结构(ISA)一个部分或一个组织信息系统的蓝图。在信息系统规划期间,你可以建立一个企业数据模型作为整个信息系统体系结构的一部分。根据Zachman(1987)、Sowa和Zachman(1992)的观点,一个信息系统体系结构由以下6个关键部分组成:数据(如图1所示,但是也有其他的表示方法)。操纵数据的处理(着系可以用数据流图、带方法的对象模型或者其他符号表示)。网络,它在组织内并在组织与它的主要业务伙伴之间传输数据(它可以通过网络连接和拓扑图来显示)。人,人执行处理并且是数据和信息的来源和接收者(人在过程模型中显示为数据的发送者和接收者)。执行过程的事件和时间点(它们可以用状态转换图和其他的方式来显示)。事件的原因和数据处理的规则(经常以文本形式显示,但是也存在一些用于规划的图表工具,如决策表)。1.2信息工程信息系统的规划者按照信息系统规划的特定方法开发出信息系统的体系结构。信息工程是一种正式的和流行的方法。信息工程是一种面向数据的创建和维护信息系统的方法。因为信息工程是面向数据的,所以当你开始理解数据库是怎样被标识和定义时,信息工程的一种简洁的解释是非常有帮助的。信息工程遵循自顶向下规划的方法,其中,特定的信息系统从对信息需求的广泛理解中推导出来(例如,我们需要关于顾客、产品、供应商、销售员和加工中心的数据),而不是合并许多详尽的信息请求(如一个订单输入屏幕或按照地域报告的销售汇总)。自顶向下规划可使开发人员更全面地规划信息系统,提供一种考虑系统组件集成的方法,增进对信息系统与业务目标的关系的理解,加深对信息系统在整个组织中的影响的理解。信息工程包括四个步骤:规划、分析、设计和实现。信息工程的规划阶段产生信息系统体系结构,包括企业数据模型。1.3信息系统规划信息系统规划的目标是使信息技术与组织的业务策略紧密结合,这种结合对于从信息系统和技术的投资中获取最大利益是非常重要的。正如表1所描述的那样,信息工程方法的规划阶段包括3个步骤,我们在后续的3个小节中讨论它们。1.确定关键性的规划因素关键性的规划因素是指组织目标、关键的成功因素和问题领域。确定这些因素的目的是建立规划的环境并且将信息系统规划与战略业务规划联系起来。表2显示了松谷家具公司的一些可能的关键规划因素,这些因素有助于信息系统的管理者为新的信息系统和数据库社顶优先级以处理需求。例如,考虑到不精确的销售预测这个问题领域,信息系统的管理者可能在组织数据库中存放额外的历史销售数据、新的市场研究数据和新产品的测试数据。-52-
2.确定组织的规划对象组织规划对象定义了业务范围,业务范围会限制后来的系统分析和信息系统可能发生改变的地方。五个关键的规划对象如下所示:●组织单元组织中的各种部门。●组织地点业务操作的发生地。●业务功能支持组织使命的业务处理的相关组。业务功能不同于组织单元,事实上一个功能可以分配给多个组织单元(例如,产品开发功能可能是销售部和生产部共同的责任)。●实体类型关于组织所管理的人,地点和事物的数据的主要类别。●信息系统处理数据集的应用软件和支持程序。3.建立企业模型一个全面的企业模型包括每个企业功能的功能分解模型、企业数据模型和各种规划矩阵。功能分解是把组织的功能进行更详细的分解过程,功能分解是在系统分析中为了简化问题、分散注意力和确定组件而使用的经典处理方法。在松谷家具公司中订单履行功能的功能分解的例子如图2所示。对于处理业务功能和支持功能的全部集合而言,多个数据库是必须的,因此一个特定的数据库可能仅仅对支持功能(如图2所示)的一个子集提供支持。为了减少数据冗余和使数据更有意义,拥有完整的、高层次的企业视图是非常有帮助的。企业数据模型使用特定的符号来描述。除了实体类型这种图形描述外,一个完整的企业数据模型还应包括每个实体类型的描述和描述业务操作的提要,即业务规则。业务规则决定数据的有效性。一个企业数据模型不仅包括实体类型,还包括数据实体间的联系,以及各种规划对象间的其他联系。显示规划对象间联系的一种常见形式是矩阵。由于规划矩阵不需要数据库被明确的建模就可以明确描述业务需求,因此规划矩阵是一种重要的功能。规划矩阵经常从业务规则中导出,它有助于社顶开发活动优先级、将开发活动排序和根据自顶向下视图通过一种企业范围的方法安排这些开发活动。有许多种规划矩阵可供使用,它们的共同之处是:●地点-功能显示业务功能在哪个业务地点执行。●单元-功能显示业务功能由哪个业务单元执行或负责。●信息系统-数据实体解释每个信息系统如何与每个数据实体相互作用(例如,是否每个系统都对每个实体中的数据进行创建、检索、更新和删除)。●支持功能-数据实体确定每个功能中数据的获取、使用、更新和删除。●信息系统-目标显示信息系统支持的每个业务目标图3举例说明了一个可能的功能-数据实体矩阵。这样的矩阵可以用于多种目的,包括以下三个目的:1)确定空白实体显示哪些数据实体没有被任何功能使用或哪个功能没有使用任何实体。2)发现丢失的实体每个功能涉及的员工通过检查矩阵能够确认任何可能丢失的实体。3)区分开发活动的优先级如果一个给顶的功能对于系统开发有高优先级(可能因为它与重要的组织目标相关),那么这个领域所使用的实体在数据库开发中拥有高优先级。Hoffer、George和Valacich(2002)的著作中有关于怎样使用规划矩阵完成信息工程和系统规划的更完整的描述。2数据库开发过程-52-
基于信息工程的信息系统规划是数据库开发项目的一个来源。这些开发新数据库的项目通常是为了满足组织的战略需求,例如改善客户支持、提高产品和库存管理或进行更精确的销售预测。然而许多数据库开发项目更多的是以自底向上的方式出现的,例如信息系统的用户需要特定的信息来完成他们的工作,从而请求开始一个项目,又如其他信息系统的专家发现组织需要改进数据管理而开始新的项目。即使在自底向上的情况下,建立企业数据模型也是必须的,以便理解现有的数据库是否可以提供所需的数据,否则,新的数据库、数据实体和属性都应该加到当前的组织数据资源中去。无论是战略需求还是操作信息的需求,每个数据库开发项目通常集中在一个数据库上。一些数据库项目仅仅集中在定义、设计和实现一个数据库,以作为后续信息系统开发的基础。然而在大多数情况下,数据库及其相关信息处理功能是作为一个完整的信息系统开发项目的一部分而被开发的。2.1系统开发生命周期指导管理信息系统开发项目的传统过程是系统开发生命周期(SDLC)。系统开发生命周期是指一个组织中由数据库设计人员和程序员组成的信息系统专家小组详细说明、开发、维护和替换信息系统的全部步骤。这个过程比作瀑布是因为每一步都流到相邻的下一步,即信息系统的规格说明是一块一块地开发出来的,每一块的输出是下一块的输入。然而如图所示,这些步骤并不是纯线性的,每个步骤在时间上有所重叠(因此可以并行地管理步骤),而且当需要重新考虑先前的决策时,还可以回滚到前面某些步骤。(因而水可以在瀑布中倒流!)图4对系统开发生命周期每一阶段的目的和可交付的产品进行了简明注解。系统开发生命周期的每一阶段都包括与数据库开发相关的活动,所以,数据库管理的问题遍布整个系统开发过程。我们在图5中重复了系统开发生命周期的七个阶段,并概述了每个阶段常见的数据库开发活动。请注意,系统开发生命周期的阶段和数据库开发步骤之间不存在一一对应的关系,概念数据建模发生在两个系统开发生命周期阶段之间。企业建模数据库开发过程从企业建模(系统开发生命周期中项目论证和选择阶段的一部分)开始设定组织数据库的范围和一般内容。企业建模发生在信息系统规划和其他活动期间,这些活动确定信息系统的哪个部分需要改变和加强并概述出全部组织数据的范围。在这一步中,检查当前数据库和信息系统,分析作为开发项目主体的业务领域的本质,用非常一般的术语描述每个信息系统在开发时所需要的数据。每个项目只有当它达到组织的预期目标时才可以进行下一步。概念数据建模对一个已经开始的信息系统项目而言,概念数据建模阶段分析信息系统的全部数据需求。它分为两个阶段。首先,它在项目开始和规划阶段建立一张类似于图1的图。同时建立其他文档来概述不考虑现存数据库的情况下特定开发项目中所需的数据范围。此时仅仅包括高层类别的数据(实体)和主要联系。然后在系统开发生命周期的分析阶段产生确定信息系统必须管理的全部组织数据的详细数据模型,定义所有数据属性,列出全部数据类别,表示数据实体间所有的业务联系,确定描述数据完整性的全部规则。在分析阶段,还要检查概念数据模型(在后面也称作概念模式)与用来解释目标信息系统其他方面的模型类别的一致性,例如处理步骤、处理数据的规则以及时间的时序。然而,即使是这样详细的概念数据模型也只是初步的,因为后续的信息系统生命周期中的活动在设计事务、报表、显示和查询时可能会发现遗漏的元素或错误。因此,经常说到的概念数据建模是以一种自顶向下的方式完成的,它由业务领域的一般理解所驱动,而不是由特定的信息处理活动所驱动。3.逻辑数据库设计逻辑数据库设计从两个角度进行数据库开发。首先,将概念数据模型变换成基于关系数据库理论的标准表示方法——-52-
关系。然后像设计信息系统的每个计算机程序(包括程序的输入和输出格式)那样,对数据库支持的事务、报表、显示和查询进行详细的检查。在这个所谓的自底向上的分析中,精确地验证数据库中需要维护的数据和在每个事务、报表等等中需要的那些数据的性质。对于每个单独的报表、事务等等的分析都要考虑一个特定的、有限制的但是完全的数据库视图。当报表、事务等被分析时有可能根据需要而改变概念数据模型。尤其在大型的项目中,不同的分析人员和系统开发者的团队可以独立地工作在不同的程序或程序集中,他们所有工作的细节直到逻辑设计阶段才可能会显示出来。在这种情况下,逻辑数据库设计阶段必须将原始的概念数据模型和这些独立的用户视图合并或集成到一个全面的设计中。在进行逻辑信息系统设计时也可以确定额外的信息处理需求,此时这些新的需求必须集成到前面确定的逻辑数据库设计中。逻辑数据库设计的最后一步是根据为生成结构良好的数据规格说明而确定的规则,将组合的、协商后的数据规格说明转换成基本的或原子的元素。对当今的大部分数据库而言,这些规则来自关系数据库理论和称作规范化的过程。这一步的结果是产生管理这些数据的、不引用任何数据库管理系统的完整的数据库描述图。在完成逻辑数据库设计后,开始确定详细的计算机程序的逻辑和维护、报告数据库内容所需的查询。4.物理数据库设计和定义物理数据库设计和定义阶段决定计算机存储器(通常是磁盘)中数据库的组织,定义数据库管理系统的物理结构,概述处理事务的程序,产生期望的管理信息和决策支持的报表。本阶段的目标是设计能够有效、安全地管理所有数据处理的数据库,因此物理数据库设计需紧密结合物理信息系统其他方面的设计,包括程序、计算机硬件、操作系统和数据通信网络。5.数据库实现数据库实现阶段编写、测试和安装处理数据库的程序。设计人员可以使用标准的编程语言(如COBOL、C或VisualBasic)、专用的数据库处理语言(如SQL),或专用的非过程化语言来编程,以产生固定格式的报表、显示结果,可能还包括图表。在实现阶段,还要完成所有的数据库文档,培训用户,为信息系统(和数据库)的用户安装程序。最后一步是利用现存的信息源(遗留应用中的文件和数据库以及现在需要的新数据)加载数据。加载数据的第一步经常是将数据从现存的文件和数据库中转到一种中间的格式(如二进制或文本文件),然后再将这些中间数据加载到新的数据库中。最后,运行数据库以及相关的应用以供实际的用户维护和检索数据。在运转期间,定期备份数据库,并当数据库损坏或受到影响时恢复数据库。6.数据库维护数据库在数据库维护期间逐渐发展。在这一步,为了满足变化的业务条件,为了改正数据库设计的错误,或数据库应用的处理速度而增加、删除或改变数据库的结构特征。当一个程序或计算机发生故障而使数据库受到影响或损坏时也可能应该重建数据库。这一步通常是数据库开发过程中最长的一步,因为它持续数据库及相关应用的整个生命周期,每次数据库的发展都可看作一个简略的数据库开发过程,其中会出现概念数据建模、逻辑和物理数据库设计以及数据库实现以处理提出的变化。2.2信息系统开发的其他方法-52-
系统开发生命周期法或其稍作变化的变体经常用于指导信息系统和数据库的开发。信息系统生命周期是一种方法学,它是高度结构化的方法,它包括许多检查和权衡以确保每一步产生精确的结果,而且新的或替代的信息系统与它必须通信的或数据定义需要一致的现存系统保持一致。系统开发生命周期法经常由于产生一个工作系统需要很长的时间而受到批评,因为工作系统仅仅在整个过程结束时才产生。现在组织越来越多的使用快速应用开发法,它是一个包含分析、设计和实现步骤的快速重复的迭代过程,直到汇聚到用户所需的系统为止。快速应用开发法在所需的数据库已经存在、增强系统主要是为了检索数据的应用中适用,而不适用于那些生成和修改数据库的应用。使用最广泛的快速应用开发法之一是原型法。原型法是一个系统开发的迭代过程,通过分析员和用户的紧密配合,持续地修改系统而最终将所有需求转换成一个工作系统。图6显示原型法的过程。在此图中我们包含了注释,概略地描述了每个原型法阶段的数据库开发活动。一般来说,当信息系统的问题被确定时,仅仅粗略地尝试概念数据建模。在开发最初的原型时,设计用户想要的显示和报表,同时理解任何新的数据库需求并定义一个用语原型的数据库。这通常是一个新的数据库,它复制现存系统的一部分,还可能增加了一些新的内容。当需要新的内容时,这些内容通常来自外部数据源,如市场研究数据、一般的经济指标或行业标准。当产生原型新的版本时重复数据库的实现和维护活动。通常仅进行最低限度的安全性和完整性控制,因为此时的重点是尽可能快地产生可以使用的原型版本。而且文档管理也延迟到项目的最后,在交付使用时才进行用户培训。最后,一旦构建了一个可接受的原型,开发者和用户将决定最后的原型和数据库是否能交付使用。如果系统(包括数据库)效率很低,那么系统和数据库将被重新编程和重新组织以达到期望的性能。随着可视化编程工具(如VisualBasic、Java、VisualC++和第四代语言)越来越流行,利用可视化编程工具可以很方便地修改用户与系统间的界面,原型法正成为可供选择的系统开发方法。使用原型法改变用户报表和显示的内容和布局是相当容易的。在这个过程中,新的数据库需求被确定,因此被发展中的应用使用的现存的数据库应该进行修改。甚至有可能为一个需要新的数据库的系统使用原型法,在这种情况下,当系统需求在迭代的开发过程中不断变化时需要获取样本数据以建造或重建数据库原型。3数据库开发的三层模式体系结构在本文前面关于数据库开发过程的解释中提到了一个系统开发项目上建立的几个不同的、但是相关的数据库视图或模型:●概念模式(在分析阶段建立)。●外部模式或用户视图(在分析阶段和逻辑设计阶段建立)。●物理模式或内部模式(在物理设计阶段建立)。图7描述了数据库这三个视图之间的关系,重要的是要记住,它们是同一个组织数据库的视图或模型。也就是说,每一个组织数据库都有一个物理模式、一个概念模式以及一个或多个用户视图。因此,三层模式体系结构用观察同一数据集的不同方式定义数据库。概念模式关于全部数据库结构的、与技术无关的规格说明。概念模式定义了整个数据库而不涉及数据怎样存储在计算机的二级存储器中。通常,概念模式用实体-联系(E-R)图或对象建模符号这样的图形格式来描述,我们把这种类型的概念模式称为数据模型。另外,概念模式的规格说明作为元数据存储在信息库或数据字典中。物理模式包括概念模式的数据怎样存储在计算机二级存储器中的规格说明。对数据库分析员和设计人员来说,重要的是物理数据库(物理模式)的定义,它提供了关于分配和管理存储和访问的数据所在的物理二级存储器空间的数据库技术的全部规格说明。数据库开发和数据库技术是以数据库这三个模式间的区分为基础的。数据库开发项目的一个角色可能仅需处理与这三个视图中的一个相关的工作。例如,一个初学者可能设计用于一个或多个程序的外部模式,而一个有经验的开发者将设计物理模式或概念模式。数据库设计问题在不同的层次上有很大的不同。4三层数据库定位体系结构显然,所有数据库中的好的事情都和“三”有关!-52-
当设计一个数据库时,你要选择把数据存放在何处。这个选择在物理数据库设计阶段作出。数据库分为个人数据库、工作组数据库、部门数据库、企业数据库和因特网数据库。个人数据库经常由最终用户自己设计和开发,仅仅由数据库专家给予培训和咨询帮助,它仅包含最终用户个人感兴趣的数据。有时候,个人数据库是从工作组数据库或企业数据库中提取出来的,这种情况下数据库专家经常编写一些提取例程来创建本地数据库。工作组数据库和部门数据库经常被最终用户、业务部门中的系统专家和中心数据库专家一起开发。这些人员的协同工作是必须的,因为在设计共享的数据库时必须权衡大量的问题:处理速度、易于使用、数据定义的差别和其他类似的问题。由于企业数据库和因特网数据库影响广、规模大,所以,通常由在集中的数据库开发小组中受过专业培训的数据库专家来开发。1.客户层一个台式计算机或笔记本也称作表示层,它专门管理用户系统界面和本地化数据,在这一层上可以执行Web脚本任务。2.服务器/Web服务器层处理HTTP协议、脚本任务,执行计算和提供数据访问,所以该层称作处理服务层。3.企业服务器(小型机或大型机)层执行复杂的计算和管理来自组织间多个数据源的数据的合并,也称作数据服务层。在一个组织中,数据库和信息系统分层的体系结构与用于分布式计算的客户/服务器体系结构的概念相关。客户/服务器体系结构基于一个局域网环境,其中服务器上(称作数据库服务器或数据库引擎)的数据库软件执行来自客户工作站的数据库命令,每个客户的应用程序专注于它们的用户接口功能。实际上,整个概念数据库(以及访问这些数据库的应用处理例程)作为一个分布式数据库或单独但是相关的物理数据库而分布在本地的PC工作站、中间的服务器(工作组或部门)和一个中心服务器(部门或企业)上。简单地说,使用客户/服务器体系结构的原因是:●它可以在多个处理器上同时处理同一个应用,因此改善了应用的响应时间和数据处理速度。●它可以利用每个计算机平台最好的数据处理特性(如PC的高级用户界面与小型机和大型机的计算速度)。●可以混合使用各种客户端的技术(装配Intel或Motorola处理器的个人计算机、网络计算机、信息站等)和共享公共数据。另外,你可以在任何层改变技术而仅对其他层系统模块的影响很小。●能够使处理靠近需处理的数据源,从而改进响应时间并减少网络通信量。●它允许和鼓励接受开放系统标准。对于数据库开发而言,使用一个多层的客户/服务器体系结构开发数据库最有意义之处在于易于将数据库开发和维护数据库的模块与向最终用户表示数据库内容的信息系统模块分隔开。表示例程能够使用像PowerBuilder、Java和VisualBasic这样的语言来提供易于使用的图形化的用户界面。通过中间件,表示例程能够通过层间相互作用来访问例程,该例程访问所需数据并分析这些数据以形成所需信息。作为一个数据库开发人员和程序员,你可以在这三层中的任何一层工作,开发必需的软件。-52-
附录Ⅱ程序代码packageadmin;importcom.DAOFactory.UserDAOFactory;importcom.DBFactory.DBOprate;importcom.entity.User;importjava.awt.Toolkit;importjava.util.List;importjava.util.Vector;importjavax.swing.JOptionPane;importjavax.swing.table.DefaultTableModel;importlogin.LoginView;/****@authorkejin.qian*/publicclassAdminViewextendsjavax.swing.JFrame{/**CreatesnewformAdminView*/publicAdminView(){initComponents();intw=(int)(Toolkit.getDefaultToolkit().getScreenSize().getWidth()-this.getWidth())/2;inth=(int)(Toolkit.getDefaultToolkit().getScreenSize().getHeight()-this.getHeight())/2;this.setLocation(w,h);this.setResizable(false);this.setVisible(true);this.setTitle("后台人员管理");select();}/***Thismethodiscalledfromwithintheconstructortoinitializetheform.*WARNING:DoNOTmodifythiscode.Thecontentofthismethodisalways*regeneratedbytheFormEditor.*/@SuppressWarnings("unchecked")////GEN-BEGIN:initComponentsprivatevoidinitComponents(){jTabbedPane1=newjavax.swing.JTabbedPane();jPanel1=newjavax.swing.JPanel();jLabel1=newjavax.swing.JLabel();jTextField1=newjavax.swing.JTextField();jButton1=newjavax.swing.JButton();jButton2=newjavax.swing.JButton();jLabel2=newjavax.swing.JLabel();jPasswordField1=newjavax.swing.JPasswordField();jLabel3=newjavax.swing.JLabel();jPasswordField2=newjavax.swing.JPasswordField();jComboBox1=newjavax.swing.JComboBox();jLabel4=newjavax.swing.JLabel();-52-
jPanel2=newjavax.swing.JPanel();jScrollPane1=newjavax.swing.JScrollPane();jTable1=newjavax.swing.JTable();jButton3=newjavax.swing.JButton();jButton4=newjavax.swing.JButton();jButton7=newjavax.swing.JButton();jPanel3=newjavax.swing.JPanel();jLabel5=newjavax.swing.JLabel();jTextField2=newjavax.swing.JTextField();jLabel6=newjavax.swing.JLabel();jPasswordField3=newjavax.swing.JPasswordField();jPasswordField4=newjavax.swing.JPasswordField();jLabel7=newjavax.swing.JLabel();jTextField3=newjavax.swing.JTextField();jLabel8=newjavax.swing.JLabel();jButton5=newjavax.swing.JButton();jLabel9=newjavax.swing.JLabel();jComboBox2=newjavax.swing.JComboBox();jButton6=newjavax.swing.JButton();setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);addWindowListener(newjava.awt.event.WindowAdapter(){publicvoidwindowClosing(java.awt.event.WindowEventevt){formWindowClosing(evt);}});getContentPane().setLayout(neworg.netbeans.lib.awtextra.AbsoluteLayout());jPanel1.setLayout(neworg.netbeans.lib.awtextra.AbsoluteLayout());jLabel1.setText("用户名");jPanel1.add(jLabel1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(70,50,-1,-1));jPanel1.add(jTextField1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(160,50,110,-1));jButton1.setText("添加用户");jButton1.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton1MouseClicked(evt);}});jPanel1.add(jButton1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(80,220,-1,-1));jButton2.setText("重置");jButton2.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton2MouseClicked(evt);}});jPanel1.add(jButton2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(190,220,90,-1));-52-
jLabel2.setText("密码");jPanel1.add(jLabel2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(80,90,-1,-1));jPanel1.add(jPasswordField1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(160,90,110,-1));jLabel3.setText("密码确认");jPanel1.add(jLabel3,neworg.netbeans.lib.awtextra.AbsoluteConstraints(70,130,-1,-1));jPanel1.add(jPasswordField2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(160,130,110,-1));jComboBox1.setModel(newjavax.swing.DefaultComboBoxModel(newString[]{"普通用户","管理员"}));jPanel1.add(jComboBox1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(160,170,110,-1));jLabel4.setText("用户权限");jPanel1.add(jLabel4,neworg.netbeans.lib.awtextra.AbsoluteConstraints(70,170,-1,-1));jTabbedPane1.addTab("添加用户",jPanel1);jPanel2.setLayout(neworg.netbeans.lib.awtextra.AbsoluteLayout());jTable1.setModel(newjavax.swing.table.DefaultTableModel(newObject[][]{},newString[]{"用户ID","用户名","用户密码","用户类型"}){/****/privatestaticfinallongserialVersionUID=1L;Class[]types=newClass[]{java.lang.String.class,java.lang.String.class,java.lang.String.class,java.lang.String.class};boolean[]canEdit=newboolean[]{false,false,false,false};publicClassgetColumnClass(intcolumnIndex){returntypes[columnIndex];}publicbooleanisCellEditable(introwIndex,intcolumnIndex){returncanEdit[columnIndex];}});jTable1.getTableHeader().setReorderingAllowed(false);jScrollPane1.setViewportView(jTable1);jTable1.getColumnModel().getColumn(0).setResizable(false);jTable1.getColumnModel().getColumn(1).setResizable(false);jTable1.getColumnModel().getColumn(2).setResizable(false);jPanel2.add(jScrollPane1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(20,10,340,162));-52-
jButton3.setText("删除用户");jButton3.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton3MouseClicked(evt);}});jPanel2.add(jButton3,neworg.netbeans.lib.awtextra.AbsoluteConstraints(150,220,-1,-1));jButton4.setText("修改用户");jButton4.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton4MouseClicked(evt);}});jPanel2.add(jButton4,neworg.netbeans.lib.awtextra.AbsoluteConstraints(240,220,-1,-1));jButton7.setText("刷新");jButton7.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton7MouseClicked(evt);}});jPanel2.add(jButton7,neworg.netbeans.lib.awtextra.AbsoluteConstraints(50,220,90,-1));jTabbedPane1.addTab("用户一览",jPanel2);jPanel3.setLayout(neworg.netbeans.lib.awtextra.AbsoluteLayout());jLabel5.setText("用户编号");jPanel3.add(jLabel5,neworg.netbeans.lib.awtextra.AbsoluteConstraints(64,54,-1,-1));jTextField2.setEditable(false);jPanel3.add(jTextField2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(130,50,110,-1));jLabel6.setText("用户密码");jPanel3.add(jLabel6,neworg.netbeans.lib.awtextra.AbsoluteConstraints(60,110,-1,-1));jPanel3.add(jPasswordField3,neworg.netbeans.lib.awtextra.AbsoluteConstraints(130,110,110,-1));jPanel3.add(jPasswordField4,neworg.netbeans.lib.awtextra.AbsoluteConstraints(130,140,110,-1));jLabel7.setText("用户名");jPanel3.add(jLabel7,neworg.netbeans.lib.awtextra.AbsoluteConstraints(70,80,-1,-1));jPanel3.add(jTextField3,-52-
neworg.netbeans.lib.awtextra.AbsoluteConstraints(130,80,110,-1));jLabel8.setText("确认密码");jPanel3.add(jLabel8,neworg.netbeans.lib.awtextra.AbsoluteConstraints(60,140,-1,-1));jButton5.setText("修改用户");jButton5.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton5MouseClicked(evt);}});jPanel3.add(jButton5,neworg.netbeans.lib.awtextra.AbsoluteConstraints(90,210,-1,-1));jLabel9.setText("用户权限");jPanel3.add(jLabel9,neworg.netbeans.lib.awtextra.AbsoluteConstraints(60,170,-1,-1));jComboBox2.setModel(newjavax.swing.DefaultComboBoxModel(newString[]{"普通用户","管理员"}));jPanel3.add(jComboBox2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(130,170,-1,-1));jButton6.setText("取消");jButton6.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton6MouseClicked(evt);}});jPanel3.add(jButton6,neworg.netbeans.lib.awtextra.AbsoluteConstraints(200,210,90,-1));jTabbedPane1.addTab("修改用户",jPanel3);getContentPane().add(jTabbedPane1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(0,0,400,300));pack();}privatevoidjButton1MouseClicked(java.awt.event.MouseEventevt){//GEN-FIRST:event_jButton1MouseClickedif(jTextField1.getText().equals("")){JOptionPane.showMessageDialog(null,"用户名不能为空");return;}if(jPasswordField1.getText().equals("")||jPasswordField2.getText().equals("")){JOptionPane.showMessageDialog(null,"密码不能为空,请重新输入");return;-52-
}if(!jPasswordField1.getText().equals(jPasswordField2.getText())){JOptionPane.showMessageDialog(null,"两次密码输入不一致,原密码没有修改");return;}StringnewPassWord=newString(jPasswordField2.getPassword());StringuserName=jTextField1.getText();if(UserDAOFactory.getInstence().checkUserName(userName)){JOptionPane.showMessageDialog(null,"用户名已存在,请重新输入");return;}Useruser=newUser();user.setUname(userName);user.setUpassw(newPassWord);user.setPermission((String)jComboBox1.getSelectedItem());UserDAOFactory.getInstence().addUser(user);JOptionPane.showMessageDialog(null,"用户添加成功");jTextField1.setText("");jPasswordField1.setText("");jPasswordField2.setText("");select();}//GEN-LAST:event_jButton1MouseClickedpublicvoidselect(){ListuserList=UserDAOFactory.getInstence().findAll();DefaultTableModeltableModel=(DefaultTableModel)jTable1.getModel();intprevious=tableModel.getRowCount();for(intk=0;krepairList=RepairDAOFactory.getInstence().findBad();DefaultTableModeltableModel=(DefaultTableModel)jTable1.getModel();intprevious=tableModel.getRowCount();for(intk=0;k//GEN-BEGIN:initComponentsprivatevoidinitComponents(){jScrollPane1=newjavax.swing.JScrollPane();jTable1=newjavax.swing.JTable();jLabel1=newjavax.swing.JLabel();jTextField1=newjavax.swing.JTextField();jLabel2=newjavax.swing.JLabel();jTextField2=newjavax.swing.JTextField();jLabel3=newjavax.swing.JLabel();jScrollPane2=newjavax.swing.JScrollPane();jTextArea1=newjavax.swing.JTextArea();jScrollPane3=newjavax.swing.JScrollPane();jTextArea2=newjavax.swing.JTextArea();jLabel4=newjavax.swing.JLabel();jButton1=newjavax.swing.JButton();jButton2=newjavax.swing.JButton();setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);-52-
addWindowListener(newjava.awt.event.WindowAdapter(){publicvoidwindowClosing(java.awt.event.WindowEventevt){formWindowClosing(evt);}});getContentPane().setLayout(neworg.netbeans.lib.awtextra.AbsoluteLayout());jTable1.setModel(newjavax.swing.table.DefaultTableModel(newObject[][]{},newString[]{"设备ID","维修情况","维修日期","操作员"}){Class[]types=newClass[]{java.lang.String.class,java.lang.String.class,java.lang.String.class,java.lang.String.class};boolean[]canEdit=newboolean[]{false,false,false,false};publicClassgetColumnClass(intcolumnIndex){returntypes[columnIndex];}publicbooleanisCellEditable(introwIndex,intcolumnIndex){returncanEdit[columnIndex];}});jTable1.getTableHeader().setReorderingAllowed(false);jTable1.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jTable1MouseClicked(evt);}});jScrollPane1.setViewportView(jTable1);jTable1.getColumnModel().getColumn(0).setResizable(false);jTable1.getColumnModel().getColumn(1).setResizable(false);jTable1.getColumnModel().getColumn(2).setResizable(false);jTable1.getColumnModel().getColumn(3).setResizable(false);getContentPane().add(jScrollPane1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(10,0,456,130));jLabel1.setText("设备编号");getContentPane().add(jLabel1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(30,160,-1,-1));jTextField1.setEditable(false);getContentPane().add(jTextField1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(100,160,90,-1));jLabel2.setText("报修日期");getContentPane().add(jLabel2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(30,200,-1,-52-
-1));jTextField2.setEditable(false);getContentPane().add(jTextField2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(100,200,90,-1));jLabel3.setText("随坏情况");getContentPane().add(jLabel3,neworg.netbeans.lib.awtextra.AbsoluteConstraints(20,240,-1,-1));jScrollPane2.setAutoscrolls(true);jTextArea1.setColumns(20);jTextArea1.setEditable(false);jTextArea1.setRows(5);jTextArea1.setPreferredSize(newjava.awt.Dimension(100,104));jScrollPane2.setViewportView(jTextArea1);getContentPane().add(jScrollPane2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(80,230,190,-1));jTextArea2.setColumns(20);jTextArea2.setRows(5);jScrollPane3.setViewportView(jTextArea2);getContentPane().add(jScrollPane3,neworg.netbeans.lib.awtextra.AbsoluteConstraints(290,150,200,140));jLabel4.setText("解决方案");getContentPane().add(jLabel4,neworg.netbeans.lib.awtextra.AbsoluteConstraints(230,180,-1,-1));jButton1.setText("维修");jButton1.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton1MouseClicked(evt);}});getContentPane().add(jButton1,neworg.netbeans.lib.awtextra.AbsoluteConstraints(300,320,90,-1));jButton2.setText("返回");jButton2.addMouseListener(newjava.awt.event.MouseAdapter(){publicvoidmouseClicked(java.awt.event.MouseEventevt){jButton2MouseClicked(evt);}-52-
});getContentPane().add(jButton2,neworg.netbeans.lib.awtextra.AbsoluteConstraints(400,320,90,-1));pack();}////GEN-END:initComponentsprivatevoidjButton1MouseClicked(java.awt.event.MouseEventevt){//GEN-FIRST:event_jButton1MouseClicked//TODOaddyourhandlingcodehere:StringrSolve=jTextArea2.getText();if(rSolve.equals("")){JOptionPane.showMessageDialog(null,"解决方案不能为空");return;}intflag=JOptionPane.showConfirmDialog(null,"确认维修?");if(flag!=0)return;RepairDAOFactory.getInstence().solve(rSolve,this.did,mainView.user.getUid());select();}//GEN-LAST:event_jButton1MouseClickedprivatevoidjButton2MouseClicked(java.awt.event.MouseEventevt){//GEN-FIRST:event_jButton2MouseClicked//TODOaddyourhandlingcodehere:whenClose();}//GEN-LAST:event_jButton2MouseClickedprivatevoidformWindowClosing(java.awt.event.WindowEventevt){//GEN-FIRST:event_formWindowClosing//TODOaddyourhandlingcodehere:whenClose();}//GEN-LAST:event_formWindowClosingprivatevoidjTable1MouseClicked(java.awt.event.MouseEventevt){//GEN-FIRST:event_jTable1MouseClicked//TODOaddyourhandlingcodehere:}//GEN-LAST:event_jTable1MouseClickedpublicvoidwhenClose(){mainView.setVisible(true);this.dispose();mainView.deviceView.select();mainView.loanView.select();mainView.repariView.showAll();}/***@paramargs*thecommandlinearguments*/-52-
//Variablesdeclaration-donotmodify//GEN-BEGIN:variablesprivatejavax.swing.JButtonjButton1;privatejavax.swing.JButtonjButton2;privatejavax.swing.JLabeljLabel1;privatejavax.swing.JLabeljLabel2;privatejavax.swing.JLabeljLabel3;privatejavax.swing.JLabeljLabel4;privatejavax.swing.JScrollPanejScrollPane1;privatejavax.swing.JScrollPanejScrollPane2;privatejavax.swing.JScrollPanejScrollPane3;privatejavax.swing.JTablejTable1;privatejavax.swing.JTextAreajTextArea1;privatejavax.swing.JTextAreajTextArea2;privatejavax.swing.JTextFieldjTextField1;privatejavax.swing.JTextFieldjTextField2;//Endofvariablesdeclaration//GEN-END:variables}-52-