网上办公系统设计与实现

目录

前言

1问题定义

1.1系统名称

1.2系统背景

1.3系统目标

2 可行性分析

2.1 经济可行性

2.2 技术可行性

2.3 操作可行性

2.4 法律可行性

2.5 可行性研究结论

2.6 用户组织机构图

2.7 目标系统业务流程图

2.8 接口设计

2.8.1外部接口

2.8.2 内部接口

3 需求分析

3.1 系统功能描述

3.2 系统功能结构图

3.3 系统逻辑模型

3.4 逻辑模型详细描述

3.4.1系统数据流图描述

3.4.2 数据字典概述

3.4.3 数据流定义

3.4.4 数据存储定义

3.4.5 数据处理定义

3.4.6 数据元素定义

4 总体设计

4.1 系统H

4.2 模块IPO

4.3 数据库设计

4.3.1 概念模型设计

4.3.2 关系模型设计

4.3.3 数据字典

5 详细设计

5.1 模块描述

5.1.1 程序流程图中的符号及含义

5.1.2 登陆

5.1.3 员工发布公告

5.1.4 设定员工密码

5.2 页面设计

5.2.1 查看部门信息

5.2.2 员工发送短信息

5.2.3 管理员添加员工状态

5.2.4 管理员设定员工密码

6 编码

6.1 编码工具的选择

6.2 编码的特点

6.3 页面设计

6.3.1 员工登录页面设计

6.3.2 员工发送公文页面设计

6.3.3 管理员添加员工信息页面设计

6.3.4 管理员查看部门信息页面设计

6.3.5 管理员查看在线信息页面设计

6.4 源程序清单

7 测试设计

7.1 测试的目标

7.2 测试的方法

7.3 单元测试

7.4 系统测试

7.5 系统维护

8 系统使用说明

8.1 软硬件配置

8.2 外部配置

8.3 软件使用方法

结论

致谢

参考文献

附录A  译文

附录 B 外文文献

附录C  JAVA程序代码

前言

随着信息技术的飞速发展和日趋激烈的商业竞争,企业已不再满足于传统的复杂的办公形式,它们需要协同工作、综合化的解决方案,而网络是解决由于物理距离造成的信息交流不畅、协商沟通不便的办公瓶颈问题的最佳方式。网上办公系统对流程控制的规定是很严格的,特别是在公文流程方面。我做的网上办公系统,基本能完成简单的网上办公工作。

作为计算机应用的一部分,使用计算机对公司的日常工作进行管理,比起以纸张为介质的传统办公模式,具有无法比拟的优点。比如检索迅速、查找方便、可靠性高、存储量大等。这些优点能够极大地提高公司日常工作的效率,也是正规化管理,与世界接轨的重要条件 。

本论文对我所设计的课题进行了较完整、详细的描述。其中第一章为问题的定义,简要介绍系统的开发目标和背景;第二章为可行性研究,给出系统的业务流图;第三章为需求分析,分析了系统在功能上的要求;第四章为总体设计,在前几章的基础上确定系统总体结构和模块外部设计;第五章为详细设计,具体的设计出每个模块的功能实现;第六章为编码,编写程序脚本; 第七章为测试,证实系统是否能够正常工作;第八章是用户使用手册;最后是结束语和参考书目。整个设计过程力求按软件工程教学中软件开发的步骤进行,循序渐进,前后呼应。系统程序经过多次上机调试,证明是正确的,是可行的。

由于信息技术日新月异,其应用不断深入发展,而我水平有限,经验不足,所以设计中难免有许多不妥和错漏之处,请同行、老师予以指正。

1问题定义

1.1系统名称

网上办公系统

1.2系统背景

当今社会是一个信息飞速发展的社会,因此,针对各行业来说,为了达到求质量、求速度,尽可能的脱离手工操作的目标,现在都开始应用计算机来管理公司的日常事务。

在现代社会中,任何一个行业,任何一个企业,高效准确的办公都是至关重要的。快捷的信息交流,畅通的公文传递,迅速的资料查询,自动的工作流转等等都能提高一个企业的办公效率,进而提高其市场竞争力。

传统的办公模式主要以纸介质为主,在计算机飞速发展的今天,显然已经远远不能满足高效率、快节奏的现代工作和生活的需要。网络技术的迅猛发展,为信息的交流和共享,团队的协同运作提供了技术的保证,同时也预示着网络化办公时代的来临。

      据了解现在企业日常管理中,企业员工管理、文件流转等功能都是核心功能。通过基于网络的办公自动化系统,就可以实现企业对员工信息方便的进行管理,也可以大大的提高文件的传输速度,从而提高了企业的工作效率。

要想实现办公自动化,就需要实施计算机管理。所以,我开发了这个网上办公系统,此系统是基于网络的,安装方便,易于维护。

1.3系统目标

本系统是根据企业日常办公的需求进行开发设计的,主要实现如下目标:

通过本系统实现企业办公自动化管理。利用计算机高效率的特点实行快速的信息查询、员工信息管理、查看职位信息和部门信息、短信息的发送与接收管理、在线信息的查看、员工账号管理,完全替代落后的人工管理,为企业节省人力物力资源。

2 可行性分析

可行性分析(Feasibility Analysis)也称为可行性研究,是在系统调查的基础上,针对新系统的开发是否具备必要性和可能性,对新系统的开发从技术、经济、操作的方面进行分析和研究,以避免投资失误,保证新系统的开发成功。可行性研究的目的就是用最小的代价在尽可能短的时间内确定问题是否能够解决。

2.1 经济可行性

与其它的系统相比,本系统独立性相当强,只需要投入较少的资金即可。而它的成功运行将节省大量的人力物力,使原来从事这方面工作的人员可以投入到更为实际的工作中,提高各部门的工作效率,而且对于任何一个企业来说,投入这样一个系统在经济方面绝对可行。

2.2 技术可行性

针对目前的编程语言而言,目标系统比较适合采用流行的JAVA语言进行编写。JAVA 是 SUN 公司推出的一种编程语言。它是一种通过解释方式来执行的语言,语法规则和 C++ 类似。JAVA 有许多值得称道的优点,如简单、面向对象、分布式、解释性、可靠、安全、结构中立性、可移植性、高性能、多线程、动态性等。 JAVA 摈弃了 C++ 中各种弊大于利的功能和许多很少用到的功能。JAVA 可以运行于任何微处理器,用 JAVA 开发的程序可以在网络上传输,并运行于任何客户机上。[4]

Java具有简单易用、完全面向对象、具有平台无关性且安全可靠的特点,完全适合作为面向Internet的开发工具,因此本系统的开发在技术上具有可行性。

2.3 操作可行性

从目标系统使用难易程度上来看并不复杂,界面设计亲切,容易使用。系统管理员要有一定的数据库方面的知识,要掌握设置数据源连接数据库的方法并要对公司的运作有较为深入的了解。但只需专业人事做短期的培训就可以拥有熟练使用系统的能力。最后,就是需要操作员对本系统的各部分功能有全面的了解。因此,本系统在操作上是完全可行的。

2.4 法律可行性

网上办公系统是根据现在的企业公司的实际情况而开发的管理系统,是具有实际意义的,公司人员管理,公司公文管理,业务管理、信息发布等方面的网络通信系统,由于是毕业设计所以不同于以往的软件开发,因此不存在侵权问题,在法律上是可行的。

2.5 可行性研究结论

综上所述,本系统是完全可行的。在技术,操作,经济,法律发面都具有实际的可行性。因此,系统可以进行开发。

2.6 用户组织机构图

2.7 目标系统业务流程图

表示数据存储 表示输入/输出的信息

表示数据流向   表示处理

图2-2系统业务流图

Fig.2-2 Stream map of system’s operation

2.8 接口设计

接口设计主要包括:

  1. 外部接口:

用户界面;

软件接口;

硬件接口;

  1. 内部接口

2.8.1外部接口

1)用户界面

在用户界面部分,根据需求分析的结果,用户需要一个友善、简洁的界面使用Dreamweaver编程。

2)软件接口

使用SQLServer自己提供的连接池技术连接数据库。

3)硬件接口

在输入方面,用键盘,鼠标进行输入。

在输出方面,使用显示器。

在网络传输部分的网络硬件部分,为了实现高速传输,使用快速以太网。

2.8.2 内部接口

内部接口方面,各模块之间采用函数调用、参数传递、返回值的方式进行信息传递。

3 需求分析

通过对一些典型网上办公系统的考察、分析,并结合企业要求,本系统具有以下功能:

  1. 员工管理模块:对公告、公文进行管理,可以对员工的信息进行浏览,可以查看部门和职位信息,可以收发信息、删除读的短信息。
  2. 管理员管理模块:对部门信息、职位信息、公告信息进行管理,具有查看公文功能、员工信息管理功能、员工账号的管理功能、短信息的查看、删除功能,查看在线员工功能、员工在职状态管理功能。

3.1 系统功能描述

1.登录模块:它是由管理员登录模块与员工登录模块组成。管理员的用户名与密码被保存在属性文件中,所以在管理员登录中要对属性文件进行读取,而员工的用户名与密码被保存在数据库中,登录时从数据库中读取。员工登录与管理员登录都向Servlet提交数据,但有所不同的是二者提交的Servlet不同,处理的方法也不同。

2.部门,职位,员工状态管理模块:部门,职位及员工状态管理这三个模块非常相            

似,但员工状态管理只有管理员权限的用户才可以操作,员工无权对其做任何操作。

3.公告管理模块:所有员工都有权发布、查看公告,管理员才有权删除及查看。

4.公文管理模块:公文发送包括公文的正文与附件两部分。当一方用户给另一方发

送公文后,另一方用户就可以点击“接收公文”链接,接收发送给自己的公文正文信息被保存在数据库中,附件信息被保存在服务器上。只有员工有权发送公文,点击“公文管理”中“发送最新公文”链接,将直接访问Servlet。

5.员工管理模块:管理员有权管理员工的各项信息,点击“浏览员工信息”的链接,

将显示所有员工的详细信息。员工信息查询是根据员工信息表中的某一字段做模糊查询,再把员工的一些字段存放在下拉列表中,让用选择想要按什么字段查询,这样方便管理员操作。员工只有权浏览员工信息。

6.账号管理模块:该模块只有管理员才能使用,在管理员给员工设定密码的同时,

也是对员工的登录id做了激活,如果员工是第一次设定密码,则把员工的密码与员工登录的id保存,否则就直接更新员工密码。

7.短信息管理模块:发送短信息是为用户与用户之间相互交流提供方便而设计的,

在发送短信息时,要指定收信人的用户编号。

8.在线管理模块:管理员对在线人员进行查看。

3.2 系统功能结构图

图3-1 网上办公系统(员工)

Fig3-1Web-based office automation system(employee)

           

    

    

    

    

                             

                          

图3-2 网上办公系统(管理员)

Fig3-2Web-based office automation system(manager)

3.3 系统逻辑模型

数据流程图描述系统的逻辑模型,不涉及硬、软件,数据结果与文件组织,用图形描述及相关的注释表示系统的逻辑功能。图中没有具体的物理元素,只是描述信息在系统中流动和处理的情况。在对网上办公系统调研阶段的业务流程图进行分析的基础上,从系统的科学性、管理的合理性、实际运用的可行性角度出发,将信息处理功能和彼此之间的联系自顶向下、逐层分解,从逻辑上精确地描述新系统应具有的数据加工功能、数据输入、数据输出、数据存储及数据来源和去向(外部项)。[3]

3.4 逻辑模型详细描述 

数据流图(DFD)是一种图形化技术,它描绘信息流和数据从输入移动到输出的过程中所经受的变换。数据流图描绘系统的逻辑模型,图中没有任何具体的物理元素,只是描绘信息在系统中流动和处理的情况。因为数据流图是逻辑系统的图形表示,即使不是专业的计算机技术人员也容易理解,所以是极好的通信工具。此外,设计数据流图只需考虑系统必须完成的基本逻辑功能,完全不需要考虑如何具体地实现这些功能,所以它也是软件设计的很好的出发点。

3.4.1系统数据流图描述

图形符号

名称

符号说明

  

数据源点/终点

记述系统之外的数据提供或数据获得组织结构或个人

处理

记述某种业务的手工或计算机处理

数据存储

记述与处理有关的数据存储

数据流

记述数据流的流动方向

表3-1数据流图符号图例

Tab.3-1 Sign legend of data stream

                                                                  

图3-3 系统TOP图

Fig.3-3 System TOP map

    

    

    

   

    

   

  

   

    

  

   

  

  

     

   

  

    

   

  

   

    

   

   

    

  

    

  

   

   

   

  

    

  

图3-4 一级细画

Fig.3-4 First rank detail map

  

图3-5 二级细画

Fig.3-5 Second rank detail map

3.4.2 数据字典概述

数据字典是关于数据的信息的集合,是对数据流图中包含的所有元素的定义的集合。任何字典最主要的用途都是供人查阅对不了解的条目的解释,数据字典的作用也正是在软件分析和设计的过程中给人提供关于数据的描述信息。

3.4.3 数据流定义

3.4.4 数据存储定义

  

  

  

  

3.4.5 数据处理定义

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  

3.4.6 数据元素定义

     

   

   

  

   

   

     

       

     

    

     

  

  

  

     

  

     

    

  

  

  

  

4 总体设计

总体设计的指导思想是结构化法。总体设计的目标是:在保证实现逻辑模型的基础上尽可能地提高系统的各项指标,即可靠性、工作质量、工作效率和经济性等,故总体设计的指标是衡量总体设计好坏的准则。对这四个方面的指标,在一定程度上既是互相矛盾的又是相辅相成的。对于不同的系统,由于功能及系统目标的不同,对上述指标的要求各有所侧重。

4.1 系统H图

用HIPO图可以自顶向下分解所得系统的模块层次结构。应用HIPO技术可以进行系统设计、评价,在系统实施之前加工和修改已设计的系统。

  图4-1 网上办公系统H图

Fig.4-1Web-based office automaion system H map

图4-2 信息显示系统H图

Fig.4-2 System of output information H map

图4-3 信息处理系统H图

Fig.4-3 System of input information H map

4.2 模块IPO图

IPO图可以用来描述模块。IPO图实际上是一张图形化的表格。它描述分层图中每一个模块的输入、输出关系、处理内容、本模块的内部数据和模块的调用关系,是系统设计的重要成果,是系统实施阶段编程序设计任务书和程序设计的出发点和依据。

本系统的模块设计严格参照H图,具体设计请参见下表:

  

    

      

    

  

    

      

  

  

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

  

    

      

    

  

4.3 数据库设计

数据库设计是指在现有数据库管理系统上建立数据库的过程,它是管理信息系统的重要组成部分。其设计内容是:对于一个特定的环境,进行符合应用语义的逻辑设计,以及提供一个确定存贮结构和物理设计,建立实现系统目标,并能有效存取数据和数据模型。

在本系统的设计中,充分考虑到了管理系统数据繁杂,重复性很大,数据使用频繁。因此本系统采用了一种能正确反映用户实现环境,能被现行系统接受,易于维护、效率高的数据管理方法。[1]

4.3.1 概念模型设计

                                          

    

            

                  

      

                           

  

图4-4 系统E-R图

Fig.4-4Map of system’s E-R

表4-1实体及其属性

Tab.4-1 Entities and their attribute table

实体名称

属性

公文

公文编号,发送方员工账号,接收方员工账号,公文标题,发布时间,公文内容,附加内容,是否核对,是否接收

员工

员工账号,员工姓名,员工性别,员工生日,学位,邮政编码,部门编号,职位编号,电话,地址,员工状态编号

短信息

短信息编号,短信息标题,发布时间,接收方员工账号,发送方员工账号,短信息内容,是否为新

公告

公告编号,公告标题,发布时间,员工账号,公告内容

部门

部门编号,部门名称,描述信息

员工状态

员工状态编号,员工状态名称,描述信息

职位

职位编号,职位名称,描述信息

密码

员工账号,员工密码,最后激活时间

表4-2 实体间联系及其属性表

Tab.4-2 Relation between one entity and entity and their attribute table

实体联系

联系属性

员工-收/发-公告

员工账号

员工-收/发-短信息

员工账号

员工-收/发-公文

员工账号

实体联系

联系属性

管理员-管理-密码

员工账号

管理员-管理-公告

公告编号

管理员-管理-短信息

短信息编号

管理员-管理-公文

公文编号

管理员-管理-职位

职位编号

管理员-管理-员工

员工账号

管理员-管理-员工状态

员工状态

管理员-管理-部门

部门编号

4.3.2 关系模型设计

关系模式:(下划线标注为主键)

公文表:(公文编号,发送方员工账号,接收方员工账号,公文标题,发布时间,公文内容,附加内容,是否核对,是否接收)

员工信息表:(员工账号,员工姓名,员工性别,员工生日,学位,邮政编码,部号,职位编号,电话,地址,员工状态编号)

短信息表:(短信息编号,短信息标题,发布时间,接收方员工账号,发送方员工账号,短信息内容,是否为新)

公告表:(公告编号,公告标题,发布时间,员工编号,公告内容)

  

部门表:(部门编号,部门名称,描述信息)

员工状态表:(员工状态编号,员工状态名称,描述信息)

职位表:(职位编号,职位名称,描述信息)

密码表:(员工编号,员工密码,时间)

4.3.3 数据字典

表4-3 公文表

Tab.4-3 Corporation’s indent table

表bumf的结构

字段名

数据类型

长度

是否主键

描述

bumfid

int

4

公文编号

Sender

int

4

发送方员工账号

accepter

int

4

接收方员工账号

title

varchar

40

公文标题

[time]

datatime

8

发布时间

content

text

16

公文内容

affix

varchar

40

附加内容

examine

bit

1

检查

sign

bit

1

是否接收

表4-4 员工信息表

Tab.4-4 Corporation’s indent table

表eminfo的结构

字段名

数据类型

长度

是否主键

描述

employeeid

int

4

员工账号

name

varchar

20

员工姓名

sex

bit

1

员工性别

birthday

datatime

8

员工生日

learn

varchar

10

学位

post

varchar

10

邮政编码

department

int

4

部门编号

jobid

int

4

职位编号

tel

varchar

20

电话

addr

varchar

100

地址

stateid

int

4

员工状态编号

表4-5 短信息表

Tab.4-5 Corporation’s indent table

表info的结构

字段名

数据类型

长度

是否主键

描述

infoid

int

4

短信息编号

title

varchar

40

短信息标题

[time]

datatime

8

发布时间

sender

int

4

发送方员工账号

accepter

int

4

接发方员工账号

content

text

16

短信息内容

new

bit

1

是否为新

表4-6 公告表

Tab.4-6 Corporation’s indent table

表affice的结构

字段名

数据类型

长度

是否主键

描述

afficeid

int

4

公告编号

title

varchar

40

公告标题

[time]

datatime

8

发布时间

employeeid

int

4

员工账号

content

text

16

公告内容

表4-7 部门表

Tab.4-7 Corporation’s indent table

表department的结构

字段名

数据类型

长度

是否主键

描述

departmentid

int

4

部门编号

name

varchar

20

部门名称

explain

text

16

描述信息

表4-8 员工状态表

Tab.4-8 Corporation’s indent table

表emstate的结构

字段名

数据类型

长度

是否主键

描述

stateid

int

4

员工状态编号

name

varchar

10

员工状态名称

explain

text

16

描述信息

表4-9 职位表

Tab.4-9Corporation’s indent table

表job的结构

字段名

数据类型

长度

是否主键

描述

jobid

int

4

职位编号

name

varchar

20

职位名称

explain

text

16

描述信息

表4-10员工密码表

Tab.4-10Corporation’s indent table

表passwordt的结构

字段名

数据类型

长度

是否主键

描述

employeeid

int

4

员工账号

password

varchar

20

员工密码

[time]

datatime

8

时间

5 详细设计

详细设计阶段的根本目标是确定应该怎样具体地实现所要求的系统,也就是说,经过这个阶段的设计工作,应该得出对目标系统的精确描述,从而在编码阶段可以把这个描述直接翻译成用某种程序设计语言书写的程序。

详细设计阶段的关键任务是确定怎么样具体的实现用户需要的软件系统,也就是要设计出程序的“蓝图”。除了应该保证软件的可靠性之外,使将来编写出的程序容易理解、容易测试、容易修改和维护,是详细设计阶段最重要的目标。结构程序设计技术是实现上述目标的基本保证,是进行详细设计的逻辑基础。

详细设计过程中的工具可以分为图形、表格和语言3类。例如:

程序流程图,又成为程序框图,它是历史最悠久、使用最广泛的表示过程设计的方法,然而它也是用得最混乱的一种方法。

盒图(N-S),处于要有一种不允许违背结构程序设计精神的图形工具的考虑,Nassi和Shneiderman提出了盒图,又称为N-S图。盒图没与箭头,因此不允许随意转移控制。坚持使用盒图作为详细设计的工具,可以使程序员逐步养成用结构化的方式思考问题和解决问题的习惯。

PAD图,是问题分析图(problem analysis diagram)的英文缩写,自1973年由日本日立公司发明以后,已得到一定程度的推广。它用二维树形结构的图来表示程序的控制流,将这种图翻译成程序代码比较容易[2]。

5.1 模块描述

5.1.1 程序流程图中的符号及含义

                                                

 选择(分支)                                       开始或结束

  

                      

 处理                                          输入输出 

5.1.2 登陆

1)功能:实现用户登陆;

2)程序流程图:

图5-1  系统登录程序流程图

Fig.5-1 System landing programme flow chart

5.1.3 员工发布公告

图5-2  员工发布公告流程图

Fig.5-2 employee sending affice programme flow chart

5.1.4 设定员工密码

图5-3  设定员工密码流程图

Fig.5-3 installing employees’code programme flow chart

5.2 页面设计

5.2.1 查看部门信息

5.2.2 员工发送短信息

5.2.3 管理员添加员工状态

5.2.4 管理员设定员工密码

6 编码

所谓编码就是把软件设计结果翻译成用某种程序设计语言书写的程序。作为软件工程过程的一个阶段,编码是对设计的进一步具体化,因此,程序的质量主要取决于设计的质量。但是,所选用的程序设计语言的特点及编码风格也将对程序的可靠性、可读性、可测试性和可维护性产生深远的影响。

6.1 编码工具的选择

随着网络技术的发展,一种基于网络的程序设计语言—Java语言正受到越来越多的开发人员和企业的重视。Java语言是网络时代的一种重要的程序设计与语言,Java技术是重要的网络开发技术。在基于网络的应用不断扩大的今天,Java语言和基于Java的技术得到了广泛的应用,成为继C/C++后的又一通用的程序开发技术。

Java是一种简单易用、完全面向对象有平台无关性、安全可靠的、主要面向Internet的开发工具。Java自从1995年正式问世以来,它的快速发展已经让整个Web世界发生了翻天覆地的变化。随着Java Servlet的推出,Jave在电子商务方面开始崭露头角,最新的Java Server Page(JSP)技术的推出,更是让Java成为基于Web应用程序的首选开发工具。

    Java自问世以来,技术和应用发展非常快,在计算机、移动电话、家用电器等领域中无一没有Java技术的存在。在Internet上,几乎每个网页都包含Java程序或代码。随着Java的广泛应用,使它受到了史无前例的关注,Java是一种Internet编程语言,Java还曾是网络动态技术的代名词,Java虚拟机更是让人耳目一新,Java简单易学,跨平带而又不失强大功能。

6.2 编码的特点

1)语言简洁、紧凑、使用方便、灵活。

2)语法限制不太严格,程序自由度大。

3)程序执行效率高。

6.3 页面设计

6.3.1 员工登录页面设计

图6-1 员工登录界面

Fig.6-1 Employee landing interface

6.3.2 员工发送公文页面设计

图6-2 员工发送公文界面

Fig.6-2 Employee sending bumf interface

6.3.3 管理员添加员工信息页面设计

图6-3管理员添加员工信息界面

Fig.6-3 Manager adding employees’infomation interface

6.3.4 管理员查看部门信息页面设计

图6-4 查看部门信息界面

Fig.6-4 Checking department’s information interface

6.3.5 管理员查看在线信息页面设计

图6-5 查看在线信息界面

Fig.6-5 Checking information of on line interface

6.4 源程序清单

(见附录C)

7 测试设计

7.1 测试的目标

为了暴露程序中的错误是测试的目标。所以:

1)测试是为了发现程序中的错误而执行程序的过程;

2)好的测试方案是极可能发现迄今为止尚未发现的错误的测试方法;

3)成功的测试是发现了迄今为止尚未发现的错误的测试。

7.2 测试的方法

测试任何产品都有两种方法:如果已经知道了产品应该具有的功能,可以通过测试来检验是否每个功能都能正常使用;如果知道产品的内部工作过程,可以通过测试来检验产品内部动作是否按照规格说明书的规定正常进行。前一种方法成为黑和测试,后一种方法成为白盒测试。

黑盒测试法把程序看作一个黑盒子,完全不考虑程序的内部结构和处理过程。也就是说,黑盒测试是在程序接口进行的测试,它只检查程序功能是否能按照规格说明书的规定正常使用,程序是否能适当的接受输入数据并产生正确的输出信息,程序运行过程中能否保持外部信息(例如,数据库或文件)的完整性。黑盒测试又称为功能测试。

白盒测试法与黑盒测试法相反,它的前提是可以把程序看成装在一个透明的白盒子里,测试者完全知道程序的结构和处理算法。这种方法按照程序内部的逻辑测试程序,检测程序中的主要执行通路是否能按预定要求正确工作。白盒测试又称为结构测试。

7.3 单元测试

单元测试集中检测软件设计的最小单元——模块。通常,单元测试和编码属于软件过程的同一个阶段。在编写出源程序代码并通过了编译程序的语法检查之后,就可以用详细设计描述作指南,对重要的执行通路进行测试,以便发现模块内部的错误。可以应用人工测试和计算机测试这两种不同类型的测试方法,完成单元测试工作。这两种测试方法各有所长,互相补充。通常,单元测试主要使用白盒测试技术,而且对多个模块的测试可以并行的进行。

7.4 系统测试

系统测试又称集成测试,把经过测试的子系统装配成一个完整的系统来测试。

已将网上办公系统在计算机上整体运行数次,每次运行过程中都将系统的各项功能进行了操作,都可正确实现应有功能,得到期望结果。

7.5 系统维护

所谓维护就是在软件已经交付使用之后,为了改正错误或满足新的需要而修改软件的过程。

维护是软件生命周期的最后一个阶段,也是持续时间最长代价最大的一个阶段。维护通常包括4类活动:为了纠正在使用过程中暴露出来的错误而进行的改正性维护;为了适应外部环境的变化而进行的适应性维护;为了改进原有的软件而进行的完善性维护;以及为了改进将来的可维护性和可靠性而进行的预防性维护。

1)维护的问题很多,都可归因于软件定义和软件开发的方法有缺点。在软件生命周期的头两个时期没有严格而又科学的管理和规划,几乎必然会导致在最后阶段出现问题。

2)理解别人写的程序通常非常困难,而且困难程度随着软件派制成分的减少而迅速增加。如果仅有程序代码没有说明稳当,则会出现严重的问题。

3)需要维护的软件往往没有合格的文档,或者文档资料显著不足。认识到软件必须有文档仅仅是第一步,容易理解的并且和程序代码完全一致的文档才真正有价值。

4)当要求对软件进行维护时,不能指望由开发人员给我们仔细。

8 系统使用说明

8.1 软硬件配置

1)服务器配置

CPU速度:P4 2.0G HZ以上

内存:256MB以上

Intel及其兼容产品,带有一个CDROM驱动器。

操作系统:Windows 2000 Server

数据库软件:SQLServer 2000

2)客户端配置

CPU速度:P4 1.4G HZ以上

内存:256MB以上

操作系统:Windows 9X Windows 2000以上中的一种。

8.2 外部配置

1)集线器、网线若干、10M以上网卡或自适应网卡若干、由局域网大小而定。

2)打印机一台。

8.3 软件使用方法

本系统使用简便,容易操作,界面清晰。使用人员经过简单指导,即可掌握系统的使用。

系统的安装:(以windows2000为例)

操作系统环境变量的配置

首先安装JDKTomcat,然后配置环境变量

1)右击“我的电脑”   “高级”    “环境变量”;

2)新建“系统变量”(变量值盘符以安装JDK和Tomcat的保持一致)

变量名:PATH         变量值:%JAVA_HOME%\bin

变量名:CLASSPATH     变量值:%JAVA_HOME%\lib

变量名:JAVA_HOME    变量值:C:\Program Files\j2sdk1.4.2_14

变量名:CATALINA_HOME   变量名:C:\Program Files\Apache Software Foundation\Tomcat 5.0

其次,安装数据库 SQLServer 2000。

安装完数据库以后,您只须把本系统给您的OA文件夹复制到%CATALINA_HOME%webapps文件夹下面;然后重启服务器,地址栏输入http:/localhost:8080/OA运行。

结论

这个设计不但使我熟练地掌握了软件开发工具Dreamweaver,SQLServer,Tomcat的使用,培养各锻炼了独立从事开发管理信息系统的能力,而且加深了对管理信息系统软件开发的原理、技术、方法、工具、步骤以及有关理论知识的理解和认识。

系统的主要功能都已实现,但由于时间关系,还有些细节没有完善。虽然程序具有一定的可读性,但是有些地方代码执行效率并不高。有待于随着经验的积累进一步完善。

虽然系统设计还存在很多缺欠。但是这次宝贵的毕业设计经历使我受益匪浅。在这次毕业设计中我学到了很多在书本上无法学到的开发经验。也为以后走向工作岗位奠定了良好的基础。

致谢

本次毕业设计历时近三个月,在此期间,张老师、同学和朋友给了我无私的支持和帮助,我的毕业设计能够顺利完成是与他们分不开的。在此,我要向他们表示衷心的感谢。

紧张而忙碌的毕业设计即将完成,我由衷地感到高兴,我想这将是我终生难忘的一段学习经历,因为在此期间我收获的不仅仅是知识。再次向帮助过我的老师、同学和朋友们致以最衷心的感谢!由于自身能力有限,本次设计中必然存在欠缺与疏漏之处,请各位老师批评指正。

参考文献

[1] Michael V. Mannino 数据库设计、应用开发与管理[M].第2版 北京:电子工业出版社,2005

[2] 张海藩.软件工程导论[M].第3版.北京: 清华大学出版社,2003.

[3] 萨师煊,王珊. 数据库系统概论[M].第3版.北京: 高等教育出版社,2003.

[4] 孙卫琴.Tomcat与Java Web开发技术详解[M].第1版.北京:电子工业出版社,2004.

[5] 张孝祥.Java就业培训教程[M].第1版.北京:电子工业出版社,2002 .

[6]周绪 管丽娜 白海波 编著《SQL Server2000中文版入门与提高》,清华大学出版社,2004。

[7] 导向科技,夏帮贵,刘凡馨《中文版SQL Server数据库开发培训教程》.第一版.人民邮电出版社,2005年:P269~275

[8] Mike Gunderloy Joseph L.Jorden .《SQL Server 2000 从入门到精通》.第二版.电子工业版社,2001年:P274~294

[9] 孙印杰,薛书琴.Dreamweaver 8中文版应用教程[M].第二版.北京:电子工业出版社,2006. 

[10] 敬铮等.SQL Server 高级开发与应用[M].第三版.北京:国防工业出版社,2005.

附录A  译文

1 对象介绍

计算机革命源于机器,因此我们的编程语言的起源看起来就好像机器。

但是,电脑并不仅是机器。电脑是意念发挥的工具(就像Steve Jobs常喜欢说的 “意念的自行车”一样),也是一种不同类型的表达媒介。这个工具正在开始偏离机器的样子而更像我们头脑的一部分,就像写作、绘画、雕刻、动画、电影等意念表达形式。面向对象程序设计(Object-oriented Programming,OOP)就是这样一个以电脑为表达媒介的巨大浪潮中的一环。

本章将为你介绍基本的OOP概念,包括软件开发方法的概括性介绍。本章,甚至本书都假设你对过程性语言(Procedural programming language)有某种程度的经验,这里所说的过程性语言并不一定指的是C,如果你觉得有必要在接触此书之前先在结构化设计和C语言上多下工夫。

本章提供的是背景性、补充性的材料。许多人在没有看清整个面向对象程序设计完整面貌之前,无法灵活的从事这种设计。因此,我将引入许多观念,为你奠定OOP的扎实基础。另外,有许多人在没有看到某中程度的实际运作机制之前,无法看清面向对象程序设计方法的完整面貌。这样的人如果没有程序代码在手,很容易迷失方向。如果你正属于这种人,而且渴望早点知道Java语言的细节,请你从容地跳过本章,这并不会影响你的程序编写和语言学习。不过,相信我,最终你还是会回头来填补必要的知识,借以了解对象的重要性以及怎样用对象来进行设计。

抽象化的过程

所有编程语言都提供抽象化机制。甚至可以大胆地说,我们所能解决问题的复杂度,取决于抽象化的类型和质量,所谓类型指的是“你所抽象的事物是什么”。组合语言针对底层的实体机器进行少量的抽象化,许多所谓命令式程序设计语言(如、Fortran,BASIC,C),则在组合语言基础上再抽象化,这类语言大幅度改进了组合语言,但他们所做的主要是机器本身的抽象化,你依旧无法摆脱一电脑结构进行问题思考的命运,因而无法以待解决问题的结构来做为思考标准。程序设计者必须自行建立介于机器模型(位于你所建立的问题模型的解的范围(solution space,例如电脑)内)和实际待解决问题模型(位于问题实际存在的领域(problem space)内)之间的关联性。这里需要的即是“映射”,然而这种能力并非编程语言的自身的本质,这使得程序难以撰写、维护代价高。于是便产生了编程方法(programming methods)这个产业。

另一种建立机器模型的方式,就是建立待解决问题的模型。早期的编程语言如LISP和APL都选择了观看世界的某种特定方式,分别认为“所有问题最终都是lists”,“所有问题都是演算形式”.PROLOG则将所有问题转换为一连串的决策(chains of decisions)。另外也有基于制约条件(constraint-based)编程语言,以及专门处理圆形化符号的编程语言(后者已被证明束缚太多)。这些方式对于他们所瞄准的特定题型都能提供不错的解决方案,然而一旦跳脱特定领域,就显得不合适。

面向对象方法(Object-oriented approach)更进一步。提供各式各样的工具,让程序设计者得以在问题领域中表现必要的元素。这种表达方式具备足够的一般化,使程序设计这不必受限与特定题型。我们将题域中的元素和其在解域中的表述称为对象(当然你还需要其他一些无法被类比为题域内的元素的对象)。这其中的观念是,程序可以通过导入新对象而让自己得以应用于特定领域的问题。当你阅读解法的程序代码时,就好象阅读问题本身的描述一样。这种语言比我们过去所拥有的任何语言都具备更有弹性和威力的抽象化机制。因此OOP提供了以问题描述问题的能力,而不是以解答执行的地方(电脑)的形式来描述问题。不过,当然最终还是会回到电脑本身。每个对象看起来都有点像是一部微型电脑,有自身的状态,你也可以要求执行它所提供的种种操作。如果把它们类比到真实世界,以这种角度来说似乎不错:它们都有特性和行为。

有些程序设计者认为,单靠面向对象程序设计本身,还不足以轻易解决所有程序设计问题,因而倡议所谓多模式程序设计语言,试图融合多种不同的解决方案。

Alan Kay曾经整理了Smalltalk的五大基本特征,而Smalltalk正是一个成功的面向对象程序设计语言。同时也是Java语言的根基之一。Smalltalk的特性代表面向对象程序设计最为纯净的一面:

  1. 万事万物都是对象。将对象视为神奇的变量,除了可以存储数据之外,还可以要求它执行自身所具备的操作能力。理论上你可以将待解问题中的所有观念性组成都变成程序中的对象。
  2. 程序有对象组成,对象通过消息的传递,请求其他对象进行工作。如果想对对象发出请求,必须发送消息到该对象,更具体地说你可以把消息想象是对隶属某个特定对象的函式呼唤请求。
  3. 每个对象都拥有其他对象所构成的存储。你可以借由封装即是对象的方式来产生新形态的对象。因此你可以在程序中建立复杂的体系,却将复杂的本质隐藏于对象的单纯性之下。
  4. 每个对象都有其类别。就像每个对象都是起类别的一个实例这种说法一样。类别(class)即类型(type)的同义词。不同的类别之间最重要的区分是:你能够发送什么消息给它。
  5. 同一类型的所有对象接受的消息都相同。这句话在稍后会陆续出现。由于圆形物体肯定是几何形物体,所以圆形对象肯定能接受所有可以发送给几何型对象的消息。这以为着你可以编写和几何形沟通的代码,并自动处理和几何形相关的事物。这种替代能力正是OOP最具威力的概念之一。

每个对象都有接口

亚里斯多德或许是第一个深入考究“类型”的哲人,他曾提过鱼类和鸟类这样的字眼。史上第一个对象变成语言Simula-67,则是通过基础关键字class将新类型导入程序中,从而直接引用了类别的概念。这个概念是:所有对象都是独一无二的,但也都是属于同一类别,有着共同的特性和行为的所有对象的一部分。

Simula,就像它的名字一样,诞生的目的是为了开发模拟程序。例如古典的银行出纳问题中存在许多出纳员、客户、帐号、交易及金钱单位,这正是许多对象的写照。属于同一类别的众多对象除了在程序执行时具有不同的状态外,其余完全相同,这也正是class这个关键字的由来。建立抽象数据类型,面向程序设计中的基本概念。抽象数据类型的运作方式与内建类型几乎没有区别。你可以创建属于某个类型的变量(以面向对象的说法,可称为对象或实例),也可以操作这些变量(这种行为也称为发送消息或请求),是的,你发送消息,对象能够识别消息相应的目的。每个类型的成员,都共用相同的性质,例如每个帐户都有节余金额,每个出纳员都能够处理存款动作等。此外,每个成员也有其自身状态,例如每个帐户都有不同的节余金额,每个出纳员都有各自的姓名。于是出纳员、客户、帐户、交易等等在电脑中都可以被表现为独一无二的实例,这样的实例就是对象,每个对象都属于特定的类别,该类别定义了物体的特性和行为。

虽然,我们在面向对象程序设计过程中,实际所做的是建立新的数据类型(data type),但几乎所有面向对象语言都用class这个关键字来表示类型,当你看到类型(type)关键词时,应该想到是类(class),反之亦然。

由于class描述了具有共同特性和共同行为的一组对象,所以class确实就是type,就像所有浮点数都有一组共同的特性和行为一样。其中差异在于,程序设计者借由定义class以适应问题,而不再被迫使用那些现成的data types——它们仅仅被设计用来表示机器中的某个存储单元。你可以针对自己的需求,加入新的data types,因而扩展程序语言的功能,程序设计语言能接受新的classes,同时也赋予它们和内建type一样的资料和一样的类别检验。

面向对象方法并不局限于模拟程序的发展。无论你是否同意“所有程序都是用来模拟你正在设计的那个系统”这一论点,OOP技术都可以轻易简化许多大型问题,得到简单的解决方案。

一旦class建立之后,属于该class的对象,可以任意创建。你可以操作这些对象,就像它们是存在于待解决问题中的元素一样。

确实,面向对象程序设计的挑战之一,便是在问题域里的众多元素与解域内的众多元素之间建立起一对一的对应。

现在,问题来了,你该如何使对象为你所用呢?必须有某种方式对对象发出请求,使对象能够做一些诸如完成一笔交易、在屏幕上绘图、打开某个开关只类的工作。每个对象都只能满足某些需求。对象的接口定义了它所接受的请求内容,而决定接口的是类型。我们可以拿电灯泡做一个简单的比喻:

Light lt = new Light();

lt.on();

接口规定了你能够对对象发出的请求,不过,还是得由程序代码来满足这些请求。这写代码加上被隐藏的数据,构成所谓的实现(implementation),从过程性设计的观点来看,并没有太复杂。没个类型都有一些函数对应任何可能收到的请求。当你对某个对象发出某个请求,某个函数即被调用。这一过程通常被扼要地说成发送消息到某对象,该对象知道词消息对应的目的,从而执行对应的程序代码。

本例中的类型(type/class)名称是Light,特定的Light对象名为lt,你能够对Light对象发送的请求是:将它打开,将它关闭,使它亮些,使它暗些。本例产生一个Light对象的方式是:定义lt作为对象名称,并调用new方法创建该种类别的对象。要发送消息给对象,先标示出对象名称,然后以点号连接消息请求。从使用者的观点出发,这种以对象来进行设计的形式很漂亮。

上图是UML(Unified Modeling Language)的表示:每个类以矩形表示,类名位于方格上方,你所关心的所有数据成员都放在方格中央,方格下放置成员函数,这些函数属于该对象,能够接收你所发送的消息。通常只有类名称和公开的成员函数会出被显示在UML图中,方格中央部分不画出。如果你只在乎类名,那么甚至下边部分也可以不画出。

被隐藏的实现细节

将程序员按各自的专业领域加以区分对我们的概念澄清有很大帮助。程序开发人员可分为:开发数据类型的所谓类制造者,以及在应用程序中使用他人所开发的类的客户端程序员。客户端程序员的目标是收集许多可共运用的类以便快速开发应用程序。类制造者的目标则是设计类,并且只暴露给客户端程序员应该知道的事物,隐藏其他所有事物,为什么?因为如果加以隐藏,客户端程序员便无法使用,这以为这类设计者可以改变隐藏的部分,不必担心对其他人造成攻击。隐藏部分通常代表对象内部脆弱的一环,它们很容易被不小心或不知情的客户端程序员毁坏掉。因此将实现部分隐藏起来可以减少程序bug,实现隐藏的概念再怎么强调也不过分。

在任何相互关系中,存在一个“参与者共同遵守的界线”是一件很重要的事情,当你建立一个类库时,你会和客户端程序员建立关系。他可能在某个程序中使用你的库,也可能建立一个更大的库。如果任何人都可以取用某个类的所有成员,则客户端程序员可以对该类做任何事,不受任何约束。你可能希望客户端程序员不要直接操作你的类中的某些成员,但如果缺少某种存取权限控制机制,就无法杜绝词事,导致整个对象都暴露给外界。

存取权限控制机制存在的第二个理由是:让类库设计者得以改变类的内部运作方式而不必担心影响客户端程序。举例来说,你可能想要简化开发动作,用较简单的方式来实现某一特定的类。但稍后却发现,你得重新写过才能改善其执行速度。如果界面和实现能够分割清楚,这个工作就轻而易举了。

Java使用三个关键字来设定类的存区权限:public、private和protected。这些关键字的意义和用法相当直观,这些被称为存取指定符的关键字,决定了谁才有资格使用其下所定义的东西。接在public之后的所有定义,每个人都可使用,接在private之后的所有定义,出来类开发者可以在类的成员函数中使用外,没有别人可以存取。private就像你与客户程序员之间的一堵墙,如果有人企图存取private成员,会产生编译错误,protected和private很像,所不同的是类的继承者有权使用其protected成员,但无法使用其private成员,稍后会有对继承的简短介绍。

Java还有一个所谓默认权限,当你没有使用上述任何一个指定词时,默认即为这种权限,有时候这种权限被称为“友好”权限,因为在同一个包下的其他类有权存取该类的友好成员,但在该类的包之外,友好成员即跟私有成员一样。

复用实现

一旦类开发完成并经测试,它应该代表着一段有用的代码单元,虽然很多人都对复用性有着热切的期待,但事实证明,想达到这个目的并不容易,你得具备丰富的经验和深刻的见解。一旦某个类具备了这样的设计,它便可以被重复运用,程序代码的重复运用,是面向对象程序设计所提供的最了不起的优点之一。

想要重复运用某个类,最简单的方式莫过于直接使用其所创建的对象。此外,你也可以把某个类对象置于另一个类内。我们称这种形式为产生一个成员对象,新的类可以由任意数目,任意类型的各种对象组成,这些对象可以以任何方式达到你想要的功能。由于这种方式以既有的类合成新类所以这种观念被称为组成或聚合。组成通常被称为has-a关系,就像我们说的汽车拥有引擎。

上面的UML图以实心菱形指向车子,代表组成关系,我通常采用更简单的形式,只画一条线不画菱形,代表关联关系。

通过组成,程序员可以取得极大弹性。类的成员对象通常被声明为private,使客户端程序员无法直接存取它们,这也使你得以在不干扰现有客户端程序的情形下,改动这些成员。你也可以在执行期改变成员对象,借以动态改变程序行为。稍后即将探讨继承关系,由于编译器会对通过继承而产生的类加上诸多编译器限制,因此继承不具备这样的弹性。

由于继承在面向对象程序设计中是如此重要,使得它常常被高度地、甚至过度地强调。程序设计新手于是会有一种刻板的印象,以为应该处处使用继承,这会造成误用,并导致过于复杂的设计。事实上在建立新类时,你应该先考虑组成,因为它够简单又具弹性。如此以来你的设计会更加清晰。有了一些经验之后,便能看清继承必要的运用时机。

附录 B 外文文献

1: Introduction

to Objects

The genesis of the computer revolution was in a machine. The genesis of our programming languages thus tends to look like that machine.

But computers are not so much machines as they are mind amplification tools (“bicycles for the mind,” as Steve Jobs is fond of saying) and a different kind of expressive medium. As a result, the tools are beginning to look less like machines and more like parts of our minds, and also like other forms of expression such as writing, painting, sculpture, animation, and filmmaking. Object-oriented programming (OOP) is part of this movement toward using the computer as an expressive medium.

This chapter will introduce you to the basic concepts of OOP, including an overview of development methods. This chapter, and this book, assume that you have had experience in a procedural programming language, although not necessarily C. If you think you need more preparation in programming and the syntax of C before tackling this book, you should work through the Thinking in C: Foundations for C++ and Java training CD ROM, bound in with this book and also available at www.BruceEckel.com.

This chapter is background and supplementary material. Many people do not feel comfortable wading into object-oriented programming without understanding the big picture first. Thus, there are many concepts that are introduced here to give you a solid overview of OOP. However, many other people don’t get the big picture concepts until they’ve seen some of the mechanics first; these people may become bogged down and lost without some code to get their hands on. If you’re part of this latter group and are eager to get to the specifics of the language, feel free to jump past this chapter—skipping it at this point will not prevent you from writing programs or learning the language. However, you will want to come back here eventually to fill in your knowledge so you can understand why objects are important and how to design with them.

The progress of abstraction

All programming languages provide abstractions. It can be argued that the complexity of the problems you’re able to solve is directly related to the kind and quality of abstraction. By “kind” I mean, “What is it that you are abstracting?” Assembly language is a small abstraction of the underlying machine. Many so-called “imperative” languages that followed (such as Fortran, BASIC, and C) were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requires you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model (in the “solution space,” which is the place where you’re modeling that problem, such as a computer) and the model of the problem that is actually being solved (in the “problem space,” which is the place where the problem exists). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to maintain, and as a side effect created the entire “programming methods” industry.

The alternative to modeling the machine is to model the problem you’re trying to solve. Early languages such as LISP and APL chose particular views of the world (“All problems are ultimately lists” or “All problems are algorithmic,” respectively). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the particular class of problem they’re designed to solve, but when you step outside of that domain they become awkward.

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the solution space as “objects.” (Of course, you will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, so when you read the code describing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run. There’s still a connection back to the computer, though. Each object looks quite a bit like a little computer; it has a state, and it has operations that you can ask it to perform. However, this doesn’t seem like such a bad analogy to objects in the real world—they all have characteristics and behaviors.

Some language designers have decided that object-oriented programming by itself is not adequate to easily solve all programming problems, and advocate the combination of various approaches into multiparadigm programming languages.

Alan Kay summarized five basic characteristics of Smalltalk, the first successful object-oriented language and one of the languages upon which Java is based. These characteristics represent a pure approach to object-oriented programming:

  1. Everything is an object. Think of an object as a fancy variable; it stores data, but you can “make requests” to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem you’re trying to solve (dogs, buildings, services, etc.) and represent it as an object in your program.
  2. A program is a bunch of objects telling each other what to do by sending messages. To make a request of an object, you “send a message” to that object. More concretely, you can think of a message as a request to call a function that belongs to a particular object.
  3. Each object has its own memory made up of other objects. Put another way, you create a new kind of object by making a package containing existing objects. Thus, you can build complexity in a program while hiding it behind the simplicity of objects.
  4. Every object has a type. Using the parlance, each object is an instance of a class, in which “class” is synonymous with “type.” The most important distinguishing characteristic of a class is “What messages can you send to it?”
  5. All objects of a particular type can receive the same messages. This is actually a loaded statement, as you will see later. Because an object of type “circle” is also an object of type “shape,” a circle is guaranteed to accept shape messages. This means you can write code that talks to shapes and automatically handle anything that fits the description of a shape. This substitutability is one of the most powerful concepts in OOP.

An object has an interface

Aristotle was probably the first to begin a careful study of the concept of type; he spoke of “the class of fishes and the class of birds.” The idea that all objects, while being unique, are also part of a class of objects that have characteristics and behaviors in common was used directly in the first object-oriented language, Simula-67, with its fundamental keyword class that introduces a new type into a program.

Simula, as its name implies, was created for developing simulations such as the classic “bank teller problem.” In this, you have a bunch of tellers, customers, accounts, transactions, and units of money—a lot of “objects.” Objects that are identical except for their state during a program’s execution are grouped together into “classes of objects” and that’s where the keyword class came from. Creating abstract data types (classes) is a fundamental concept in object-oriented programming. Abstract data types work almost exactly like built-in types: You can create variables of a type (called objects or instances in object-oriented parlance) and manipulate those variables (called sending messages or requests; you send a message and the object figures out what to do with it). The members (elements) of each class share some commonality: every account has a balance, every teller can accept a deposit, etc. At the same time, each member has its own state, each account has a different balance, each teller has a name. Thus, the tellers, customers, accounts, transactions, etc., can each be represented with a unique entity in the computer program. This entity is the object, and each object belongs to a particular class that defines its characteristics and behaviors.

So, although what we really do in object-oriented programming is create new data types, virtually all object-oriented programming languages use the “class” keyword. When you see the word “type” think “class” and vice versa.

Since a class describes a set of objects that have identical characteristics (data elements) and behaviors (functionality), a class is really a data type because a floating point number, for example, also has a set of characteristics and behaviors. The difference is that a programmer defines a class to fit a problem rather than being forced to use an existing data type that was designed to represent a unit of storage in a machine. You extend the programming language by adding new data types specific to your needs. The programming system welcomes the new classes and gives them all the care and type-checking that it gives to built-in types.

The object-oriented approach is not limited to building simulations. Whether or not you agree that any program is a simulation of the system you’re designing, the use of OOP techniques can easily reduce a large set of problems to a simple solution.

Once a class is established, you can make as many objects of that class as you like, and then manipulate those objects as if they are the elements that exist in the problem you are trying to solve. Indeed, one of the challenges of object-oriented programming is to create a one-to-one mapping between the elements in the problem space and objects in the solution space.

But how do you get an object to do useful work for you? There must be a way to make a request of the object so that it will do something, such as complete a transaction, draw something on the screen, or turn on a switch. And each object can satisfy only certain requests. The requests you can make of an object are defined by its interface, and the type is what determines the interface. A simple example might be a representation of a light bulb:

Light lt = new Light();

lt.on();

The interface establishes what requests you can make for a particular object. However, there must be code somewhere to satisfy that request. This, along with the hidden data, comprises the implementation. From a procedural programming standpoint, it’s not that complicated. A type has a function associated with each possible request, and when you make a particular request to an object, that function is called. This process is usually summarized by saying that you “send a message” (make a request) to an object, and the object figures out what to do with that message (it executes code).

Here, the name of the type/class is Light, the name of this particular Light object is lt, and the requests that you can make of a Light object are to turn it on, turn it off, make it brighter, or make it dimmer. You create a Light object by defining a “reference” (lt) for that object and calling new to request a new object of that type. To send a message to the object, you state the name of the object and connect it to the message request with a period (dot). From the standpoint of the user of a predefined class, that’s pretty much all there is to programming with objects.

The diagram shown above follows the format of the Unified Modeling Language (UML). Each class is represented by a box, with the type name in the top portion of the box, any data members that you care to describe in the middle portion of the box, and the member functions (the functions that belong to this object, which receive any messages you send to that object) in the bottom portion of the box. Often, only the name of the class and the public member functions are shown in UML design diagrams, and so the middle portion is not shown. If you’re interested only in the class name, then the bottom portion doesn’t need to be shown, either.

The hidden implementation

It is helpful to break up the playing field into class creators (those who create new data types) and client programmers(the class consumers who use the data types in their applications). The goal of the client programmer is to collect a toolbox full of classes to use for rapid application development. The goal of the class creator is to build a class that exposes only what’s necessary to the client programmer and keeps everything else hidden. Why? Because if it’s hidden, the client programmer can’t use it, which means that the class creator can change the hidden portion at will without worrying about the impact to anyone else. The hidden portion usually represents the tender insides of an object that could easily be corrupted by a careless or uninformed client programmer, so hiding the implementation reduces program bugs. The concept of implementation hiding cannot be overemphasized.

In any relationship it’s important to have boundaries that are respected by all parties involved. When you create a library, you establish a relationship with the client programmer, who is also a programmer, but one who is putting together an application by using your library, possibly to build a bigger library.

If all the members of a class are available to everyone, then the client programmer can do anything with that class and there’s no way to enforce rules. Even though you might really prefer that the client programmer not directly manipulate some of the members of your class, without access control there’s no way to prevent it. Everything’s naked to the world.

So the first reason for access control is to keep client programmers’ hands off portions they shouldn’t touch—parts that are necessary for the internal machinations of the data type but not part of the interface that users need in order to solve their particular problems. This is actually a service to users because they can easily see what’s important to them and what they can ignore.

The second reason for access control is to allow the library designer to change the internal workings of the class without worrying about how it will affect the client programmer. For example, you might implement a particular class in a simple fashion to ease development, and then later discover that you need to rewrite it in order to make it run faster. If the interface and implementation are clearly separated and protected, you can accomplish this easily.

Java uses three explicit keywords to set the boundaries in a class: public, private, and protected. Their use and meaning are quite straightforward. These access specifiers determine who can use the definitions that follow. public means the following definitions are available to everyone. The private keyword, on the other hand, means that no one can access those definitions except you, the creator of the type, inside member functions of that type. private is a brick wall between you and the client programmer. If someone tries to access a private member, they’ll get a compile-time error. protected acts like private, with the exception that an inheriting class has access to protected members, but not private members. Inheritance will be introduced shortly.

Java also has a “default” access, which comes into play if you don’t use one of the aforementioned specifiers. This is sometimes called “friendly” access because classes can access the friendly members of other classes in the same package, but outside of the package those same friendly members appear to be private.

Reusing the implementation

Once a class has been created and tested, it should (ideally) represent a useful unit of code. It turns out that this reusability is not nearly so easy to achieve as many would hope; it takes experience and insight to produce a good design. But once you have such a design, it begs to be reused. Code reuse is one of the greatest advantages that object-oriented programming languages provide.

The simplest way to reuse a class is to just use an object of that class directly, but you can also place an object of that class inside a new class. We call this “creating a member object.” Your new class can be made up of any number and type of other objects, in any combination that you need to achieve the functionality desired in your new class. Because you are composing a new class from existing classes, this concept is called composition (or more generally, aggregation). Composition is often referred to as a “has-a” relationship, as in “a car has an engine.”

(The above UML diagram indicates composition with the filled diamond, which states there is one car. I will typically use a simpler form: just a line, without the diamond, to indicate an association.)

Composition comes with a great deal of flexibility. The member objects of your new class are usually private, making them inaccessible to the client programmers who are using the class. This allows you to change those members without disturbing existing client code. You can also change the member objects at run-time, to dynamically change the behavior of your program. Inheritance, which is described next, does not have this flexibility since the compiler must place compile-time restrictions on classes created with inheritance.

Because inheritance is so important in object-oriented programming it is often highly emphasized, and the new programmer can get the idea that inheritance should be used everywhere. This can result in awkward and overly complicated designs. Instead, you should first look to composition when creating new classes, since it is simpler and more flexible. If you take this approach, your designs will be cleaner. Once you’ve had some experience, it will be reasonably obvious when you need inheritance.

附录C  JAVA程序代码

员工登录模块

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>管理员登录</title>

<link href="../css/style.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="../js/oa.js">

</script>

<style type="text/css">

<!--

body {

margin-right: -40px;

margin-bottom: -20px;

}

.style3 {color: #C60001; font-weight: bold; }

.style4 {font-weight: bold}

-->

</style></head>

<body>

<table width="102%" height="100%" border="0"  cellpadding="0" cellspacing="0" background="../image/back.gif"class="top2">

  <form name="form1" id="form1" method="post" action="admin" onSubmit="return login()">

    <tr>

      <td width="451" height="246" rowspan="7"> </td>

      <td height="153" colspan="3" > </td>

      <td width="70" rowspan="7" > </td>

    </tr>

    <tr>

      <td height="11" colspan="3" align="center" > </td>

    </tr>

    <tr>

      <td height="21" colspan="3" align="center" ><span class="style3">管理员登录</span></td>

    </tr>

    <tr>

      <td width="20" align="center" > </td>

      <td width="65" height="21" align="center" ><div align="center" class="style3">用户名:</div></td>

      <td width="178" height="21" align="center" ><div align="left">

        <input type="text" name="name" />

      </div></td>

    </tr>

    <tr>

      <td align="center" > </td>

      <td height="21" align="center" ><div align="center" class="style3">密  码:</div></td>

      <td height="21" align="center" class="style4" ><div align="left">

        <input type="password" name="password" />

      </div></td>

    </tr>

    <tr>

      <td height="23" colspan="3" align="center" class="style4" >

  <input type="submit" name="tijiao" value="提交">

      <input type="reset" name="Submit2" value="重置" /></td>

    </tr>

    <tr>

      <td height="21" colspan="3" class="style4" > </td>

    </tr>

  </form>

</table>

</body>

</html>

员工登录处理模块

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>员工登录</title>

<link href="../css/style.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="../js/oa.js">

</script>

<style type="text/css">

<!--

body {

margin-right: -40px;

margin-bottom: -20px;

}

.style3 {color: #C60001; font-weight: bold; }

.style4 {font-weight: bold}

-->

</style></head>

<body>

<table width="102%" height="100%" border="0"  cellpadding="0" cellspacing="0" background="../image/back.gif"class="top2">

  <form name="form1" id="form1" method="post" action="em" onSubmit="return login()">

    <tr>

      <td width="451" height="246" rowspan="7"> </td>

      <td height="153" colspan="3" > </td>

      <td width="70" rowspan="7" > </td>

    </tr>

    <tr>

      <td height="11" colspan="3" align="center" > </td>

    </tr>

    <tr>

      <td height="21" colspan="3" align="center" ><span class="style3">员工登录</span></td>

    </tr>

    <tr>

      <td width="20" align="center" > </td>

      <td width="65" height="21" align="center" ><div align="center" class="style3">员工号:</div></td>

      <td width="178" height="21" align="center" ><div align="left">

        <input type="text" name="id" />

      </div></td>

    </tr>

    <tr>

      <td align="center" > </td>

      <td height="21" align="center" ><div align="center" class="style3">密  码:</div></td>

      <td height="21" align="center" class="style4" ><div align="left">

        <input type="password" name="password" />

      </div></td>

    </tr>

    <tr>

      <td height="23" colspan="3" align="center" class="style4" >

  <input type="submit" name="tijiao" value="提交">

      <input type="reset" name="Submit2" value="重置" /></td>

    </tr>

    <tr>

      <td height="21" colspan="3" class="style4" > </td>

    </tr>

  </form>

</table>

</body>

</html>

查看公告模块

<%@ page contentType="text/html; charset=gb2312" language="java" errorPage="" %>

<%@ include file="../hear/hear.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>公告查看</title>

<link href="../css/style.css" rel="stylesheet" type="text/css" />

<script src="../js/oa.js"></script>

<style type="text/css">

<!--

.style1 {

font-size: 16px;

color: #010000;

font-weight: bold;

}

-->

</style>

</head>

<body bgcolor="#FFFFDF">

<table width="56%" height="25" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td width="94%" height="24" colspan="6" align="center" background="../KCM/zs.gif" class="advise style1">公告信息</td>

  </tr>

</table>

<table width="56%" height="48%" align="center" cellpadding="0" cellspacing="0">

  <tr align="center" class="column">

    <td width="77" height="37" bgcolor="#FFFFFF">发布人</td>

    <td width="98" height="37" bgcolor="#FFFFFF">公告标题</td>

    <td width="95" height="37" bgcolor="#FFFFFF">发布时间</td>

    <td width="231" bgcolor="#FFFFFF">具体公告</td>

    <td width="74" bgcolor="#FFFFFF">删除</td>

  </tr>

  <%

Collection coll=(Collection)request.getAttribute("msg");

if(coll==null){

%>

  <tr align="center" bgcolor="#FFFFDF">

    <td height="45" colspan="6" class="advise">没有添加公告</td>

  </tr>

  <%

}else{

Iterator it=coll.iterator();//用Collection对象的iterator()方法获得

while(it.hasNext()){

Affice dep=(Affice)it.next();

%>

  <tr align="center"  >

    <td height="33" bgcolor="#FFFFFF"><div align="center"><%=db.IdtoName(dep.getEmid())%></div></td>

    <td height="33" bgcolor="#FFFFFF"><div align="center"><%= dep.getTitle()%></div></td>

    <td height="33" bgcolor="#FFFFFF"><div align="center"><%= dep.getTime().substring(0,10)%> </div></td>

    <td height="33" bgcolor="#FFFFFF"><div align="center"><%= dep.getContent() %></div></td>

    <td height="33" bgcolor="#FFFFFF"><a href="del?afficeid=<%=dep.getId()%>"><img src="../image/empty.gif" width="20" height="20" border="0" /></a></td>

  </tr>

  <%

}

}

request.removeAttribute("msg");//移除request对象中所带的属性

%>

</table>

</body>

</html>

发送公文处理模块

<%@ page contentType="text/html; charset=gb2312" language="java" errorPage="" %>

<%@ include file="../hear/hear.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>发送公文</title>

<link href="../css/work.css" rel="stylesheet" type="text/css" />

<script src="../js/oa.js" language="javascript"></script>

<style type="text/css">

<!--

.style1 {

font-size: 16px;

color: #000000;

font-weight: bold;

}

.style2 {color: #CA0000}

-->

</style>

</head>

<body bgcolor="#FFFFDF">

<table width="780" height="25" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td width="77%" height="23" colspan="6" align="center" background="../KCM/zs.gif" class="advise style1">发送公文</td>

  </tr>

</table>

<table width="780" height="178" align="center" cellpadding="0" cellspacing="0">

<form action="save" method="post" name="form1" id="form1" enctype="multipart/form-data" οnsubmit="return bumfs()">

<%

Collection coll=(Collection)request.getAttribute("msg");

if(coll==null){

out.print("您的网页已过期请重新登录");

}else{

Iterator it=coll.iterator();

if(it.hasNext()){

Bumf bumf=(Bumf)it.next();

%>

  <tr>

    <td width="160" align="left" bgcolor="#FFFFFF" >

      <div align="right">        </div></td>

    <td width="179" height="21" align="left" bgcolor="#FFFFFF" ><input name="bumfid" type="hidden" value="<%=bumf.getId()%>" />      <span class="style2">公文第[<%=bumf.getId()%>]字号</span>          <div align="center">      </div></td>

    <td width="82" align="center" bgcolor="#FFFFFF" class="column" >

<%

String ok=(String)request.getAttribute("ok");

if(ok!=null){

out.print(ok);

}

request.removeAttribute("ok");

%>

 </td>

  </tr>

  <tr>

    <td bgcolor="#FFFFFF"><div align="right">标      题:</div></td>

     <td bgcolor="#FFFFFF">

       <div align="left">

         <input name="title" type="text" value="<%=bumf.getTitle()%>" size="15" />

      </div></td>

    <td height="16" colspan="3" align="center" bgcolor="#FFFFFF" ><div align="left">

</div></td>

    </tr>

  <tr>

    <td bgcolor="#FFFFFF"><div align="right">接收人序号:</div></td>

    <td bgcolor="#FFFFFF">

      <div align="left">

        <input name="emid" type="text" value="<%=bumf.getAccepter()%>" size="15" />

      </div></td>

    <td height="16" colspan="3" align="center" bgcolor="#FFFFFF" ><div align="left">

    </div></td>

  </tr>

  <tr>

    <td bgcolor="#FFFFFF"><div align="right">附      件:</div></td>

    <td bgcolor="#FFFFFF">

      <div align="left">

        <input name="file" type="file"  value="<%=bumf.getAffix()%>" size="15"/>

      </div></td>

    <td height="21" colspan="3" align="center" bgcolor="#FFFFFF" >

      <div align="left">      </div></td>

  </tr>

  <tr>

    <td bgcolor="#FFFFFF"><div align="right">内      容:</div></td>

    <td height="81" colspan="5" align="center" valign="top" bgcolor="#FFFFFF">

        <div align="left">

          <textarea name="bumf" cols="35" rows="5"><%=bumf.getContent()%></textarea>

      </div></td>

  </tr>

  <tr>

    <td height="21" colspan="5" align="center" bgcolor="#FFFFFF" >

      <div align="center">

        <input type="submit" name="Submit" value="现在发送" />

   

  <input type="submit" name="Submit" value="暂时保存" />

      </div>    </tr>

<%

}

}

request.removeAttribute("msg");

%> 

</form>

</table>

</body>

</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/134489.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Centos7.9 一键脚本部署 LibreNMS 网络监控系统

前言&#xff1a; LibreNMS 是个以 PHP/MySQL 为基底的自动探索网络监控系统 LibreNMS 官网 版本23.8.2-52-g7bbe0a2 - Thu Sep 14 2023 22:33:23 GMT0700数据库纲要2023_09_01_084057_application_new_defaults (259)Web 服务器nginx/1.20.1PHP8.1.23Python3.6.8DatabaseMa…

Postman的高级用法一:重新认识postman核心模块

本请求示例来自于免费天气API&#xff1a; 实况天气接口API开发指南 未来一天天气预报api - 天气API 关于Postman的核心模块 全局变量请求接口请求体预处理脚本 类似beforeTest&#xff0c;在发起请求前的预执行逻辑&#xff0c;通常是生成一些动态变量值 测试用例模块 测试者…

PhpStorm 2023年下载、安装教程和好用插件,保姆级教程

PhpStorm 2023年下载、安装教程和好用插件&#xff0c;保姆级教程 文章目录 PhpStorm 2023年下载、安装教程和好用插件&#xff0c;保姆级教程前言一、安装PhpStorm二、好用的插件简体中文包Chinese(Simplified)Language Pack 三、卸载插件CTRLN 查找类CTRLSHIFTN 全局搜索文件…

Visual Studio复制、拷贝C++项目与第三方库配置信息到新的项目中

本文介绍在Visual Studio软件中&#xff0c;复制一个已有的、配置过多种第三方库的C项目&#xff0c;将其拷贝为一个新的项目&#xff0c;同时使得新项目可以直接使用原有项目中配置好的各类**C**配置、第三方库等的方法。 在撰写C 代码时&#xff0c;如果需要用到他人撰写的第…

Linux学习第16天:Linux设备树下的LED驱动开发:举一反三 专注专心专业

Linux版本号4.1.15 芯片I.MX6ULL 大叔学Linux 品人间百味 思文短情长 在开题之前&#xff0c;先说一下这次的题目&#xff0c;尤其是后面的“举一反三 专注专心专业”到底想给大家传递什么信息。LED驱动开发&#xff0c;目前为止已经…

深入思考redis面经

1 redission分布式锁 1.1 为了保证数据一致性&#xff0c;引入了redission的锁&#xff0c;你是为了抗住高并发而去为了引入这个锁还是说为了保证数据一致性去引入的 答&#xff1a;主要是为了抗住高并发问题&#xff0c;解决redis的缓存击穿问题&#xff0c;但是也能解决一定…

Vue系列之入门篇

前言&#xff1a; 目录 一&#xff0c;关于Vue的简介 1.什么是Vue&#xff1f; 2.使用Vue框架的好处&#xff1f; 3. 库和框架的区别&#xff1a; 4. MVVM的介绍 5.Vue的入门案例 二&#xff0c;Vue的生命周期 一&#xff0c;关于Vue的简介 1.什么是Vue&#xff1f; Vu…

YSA Toon (Anime/Toon Shader)

这是一个Toon着色器/Cel阴影着色器,用于Unity URP 此着色器的目的是使角色或物体阴影实时看起来尽可能接近真实的动画或卡通效果 可以用于游戏,渲染,插图等 着色器特性,如:面的法线平滑、轮廓修复、先进的边缘照明、镜面照明、完全平滑控制 这个文档包括所有的功能https:/…

【数据结构前置知识】初识集合框架和时间,空间复杂度

文章目录 1. 什么是集合框架2. 集合框架的重要性 3. 背后所涉及的数据结构以及算法3.1 什么是数据结构3.2 容器背后对应的数据结构3.3 相关java知识3.4 什么是算法 4.时间复杂度1. 如何衡量一个算法的好坏2. 算法效率3. 时间复杂度3.1 时间复杂度的概念3.2 大O的渐进表示法3.3 …

在项目中,关于前端实现数据可视化的技术选择

前言 在项目中&#xff0c;数据可视化以图表、报表类型为主。 需求背景 技术框架是Vue2.x版本&#xff0c;组件库是Ant Design of Vue能够支撑足够多的图表类型开发图表大小/位置能够随意变动图表样式需要支持丰富多样的用户配置强大、开放的图表语法支持复杂的数据可视化场景…

内网IP端口提供外网连接访问?快解析动态域名与内网映射P2P穿透方案

我们在本地搭建服务器及发布互联网时&#xff0c;可以通过动态域名的方式联网。DDNS原理是用固定的域名代替变化IP&#xff0c;实现局域网发布公网&#xff0c;是适合本地动态IP环境的使用。但当本地没有公网IP时&#xff0c;如果解析绑定到内网IP&#xff0c;将内网IP端口提供…

坑爹,线上同步近 3w 个用户导致链路阻塞引入发的线上问题,你经历过吗?

分享一个印象深刻的线上问题&#xff0c;希望能够给 xdm 带来一点思考 一个稀松平常的工作日&#xff0c;正准备下班的时候&#xff0c;不巧&#xff0c;突发线上紧急问题&#xff0c;心中一万个不情愿&#xff0c;可还是要硬着头皮去定位问题 简单的表象为微服务之间 gRPC通…

Linux:Centos9 《下载-安装》

下载 Download (centos.org)https://www.centos.org/download/ 安装 选择第一个安装centos 根据自己需要的语言环境选择即可 这里选择要安装的磁盘&#xff0c;然后点击完成 这里选择第一个就行带有图形化 然后我们去对这两个进行设置就行 这两个地方自己进行设置就行 耐心等…

Firefox火狐浏览器显示你的连接不安全,是什么意思?

当 Firefox 连接到一个安全的网站时&#xff08;网址最开始为“https://”&#xff09;&#xff0c;它必须确认该网站出具的证书有效且使用足够高的加密强度&#xff0c;以充分保护您的隐私。如果证书无法通过验证&#xff0c;或加密强度过低&#xff0c;Firefox 会中止连接到这…

Android 系统中适配OAID获取

一、OAID概念 OAID&#xff08;Open Anonymous Identification&#xff09;是一种匿名身份识别标识符&#xff0c; 用于在移动设备上进行广告追踪和个性化广告投放。它是由中国移动通信集 团、中国电信集团和中国联通集团共同推出的一项行业标准 OAID值为一个64位的数字 二、…

认识数据分析

文章目录 1. 认识数据分析1.1 数据自身的三大属性1.2 建数仓 数据分析的工程技术1.3 数据分析解决问题的原理1.4 数据分析的具体流程1.5 数据的中心化和智能化1.6 数据分析的四种类型和六个方向 1. 认识数据分析 1.1 数据自身的三大属性 客观&#xff1a;用数字衡量和表现一件…

C语言 —— 初步入门知识(选择与循环语句、函数、数组、操作符、关键字和#define)

本篇文章将接着上篇继续介绍C语言的基础知识&#xff0c;使读者对C语言能够有一个大概的认识. 不会细写每一个知识点, 但是能够入门C语言, 进行初步的C语言代码阅读. 1. 选择语句 假设你要决定是否出门玩耍&#xff0c;如果天气晴朗&#xff0c;你就出门&#xff1b;如果天气不…

如何实现不同MongoDB实例间的数据复制?

作为一种Schema Free文档数据库&#xff0c;MongoDB因其灵活的数据模型&#xff0c;支撑业务快速迭代研发&#xff0c;广受开发者欢迎并被广泛使用。在企业使用MongoDB承载应用的过程中&#xff0c;会因为业务上云/跨云/下云/跨机房迁移/跨地域迁移、或数据库版本升级、数据库整…

详解混合类型文件(Polyglot文件)的应用生成与检测

1. 引入 混合类型文件&#xff08;Polyglot文件&#xff09;&#xff0c;是指一个文件&#xff0c;既可以是合法的A类型&#xff0c;也可以是合法的B类型。 比如参考3中的文件&#xff0c;是一个html文件&#xff0c;可以用浏览器正常打开&#xff1b;它也是一个一个.jar文件&…

vue项目打包时如何将静态文件打包到一个单独的文件夹

在Vue项目中&#xff0c;你可以使用Webpack的配置来实现将静态文件打包到一个单独的文件夹。下面是一种常见的方法&#xff1a; 在Vue项目的根目录下&#xff0c;创建一个名为static的文件夹&#xff08;如果还没有&#xff09;。这个文件夹将用于存放静态文件。在vue.config.j…