已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
原文翻译:利用ASP开发Web应用程序首先必须确立Web应用的体系结构。目前在应用中常用到的有两种:C/S体系结构和B/S体系结构。C/S体系结构即client/server,客户端/服务器端。两层的客户/服务器结构。客户/服务器(Client/Server)模型是一种良好的软件体系结构,是网络的最佳应用模式之一。从技术上看,它本身是一个逻辑概念,是指将一个应用分解成多个任务分别执行,共同完成整个应用任务的功能。网络各站点主机上资源(硬件、软件、数据)分步不均衡,在客户/服务器结构下,无资源的客户机通过向有资源的服务器发出请求,并得到资源请求,从而适应网络中资源分布的不均衡性。采用这种结构能综合各种计算机协同工作,各尽其能,实现对计算机系统的规模优化(Rightsizing)和规模缩小化(Downsizing)。如下图:从技术角度讲,“客户机”和“服务器”都是逻辑的概念,其含义是:将计算机网络应用分成两大部分,其中一部分支持多个用户共享的功能与资源,它由服务器来实现;另一部分是面向每个用户的,由客户机来实现,也就是说,客户机通常执行前台功能,通过用户界面实现人机对话,或是执行用户特定的应用程序。而服务器通常执行后台功能,管理共享的外设,接受并回答用户的请求等。对于一台计算机来说,它可以具有双重功能,在某一时刻充当服务器,而在另一时刻又成为客户机。客户/服务器类型把计算机分为两类,提供服务的一方称为服务器,请求服务的一方称为客户。为了能够提供服务,服务器一方必须具有一定的硬件和相应的服务器软件;同样,客户一方也必须具有一定的硬件和相应的客户软件。在服务器和客户之间必须有一个协议,双方根据这个协议进行通信。将客户/服务器模型应用于Internet服务, 客户与服务器之间的关系并不是一成不变的。有的Internet节点一方面提供服务,另一方面也从别的节点处获得服务;甚至在一次对话过程中,双方的角色也可能互换。如在进行文件传输时,如果把提供文件的一方称为服务器,把获取文件的一方称为客户,则在使用get 或mget命令从另一个节点取文件时,可以认为自己使用的及其是客户机,在使用put 或mput命令向另一个节点发送文件时又可以认为自己使用的机器是服务器。多层的客户/服务器结构随着企业应用的扩展,最近又出现了一种新的多层体系结构,它把客户端应用分为两部分:客户应用和服务器应用。客户应用是原来客户应用的一部分,另一部分被移入服务器应用中。新的客户应用负责用户界面和简单固定的业务逻辑,新的服务器应用驻留核心的、易变的业务逻辑。因此其结构就变成了新的(Client应用+Server应用)/Server结构。如下图所示:这种结构解决了传统Client/Server的可扩展问题,既减少了客户端业务逻辑,又降低了客户端对硬件的要求。同时,由于把许多业务逻辑集中到了单一的应用服务器上,应用系统的维护工作也被集中到了一起,消除了传统Client/Server结构中软件分发的问题。这种结构即被称为B/S体系结构。B/S体系结构即Browser/Server,浏览器/服务器端。本质上,Browser/Server也是一种Client/Server结构,它是一种由传统的二层Client/Server结构发展而来的三层Client/Server结构在Web上应用的特例。在Browser/Server的系统中,用户可以通过浏览器向分布在网络上的许多服务器发出请求。Browser/Server结构极大的简化了客户机的工作,客户机上只需安装、配置少量的客户端软件即可, 服务器将担负更多的工作,对数据库的访问和应用程序的执行将在服务器上完成。在Browser/Server三层体系结构下,表示层(Presentatioon)、功能层(Business Logic)、数据层(Data Service)被割成三个相对独立的单元: 第一层表示层:Web浏览器。 在表示层中包含系统的显示逻辑,位于客户端。它的任务是由Web浏览器向网络上的某一Web服务器提出服务请求,Web服务器对用户身份进行验证后用HTTP协议把所需的主页传送给客户端,客户机接受传来的主页文件,并把它显示在Web浏览器上。第二层功能层:具有应用程序扩展功能的Web服务器。在功能层中包含系统的事务处理逻辑,位于Web服务器端。它的任务是接受用户的请求,首先需要执行相应的扩展应用程序与数据库进行连接,通过SQL等方式向数据库服务器提出数据处理申请,而后等数据库服务器将数据处理的结果提交给Web服务器,再由Web服务器传送回客户端。第三层数据层:数据库服务器。在数据层中包含系统的数据处理逻辑,位于数据库服务器端。它的任务是接受Web服务器对数据库操纵的请求,实现对数据库查询、修改、更新等功能,把运行结果提交给Web服务器。 仔细分析不难看出,三层的Browser/Server体系结构是把二层Client/Server结构的事务处理逻辑模块从客户机的任务中分离出来,由单独组成的一层来负担其任务,这样客户机的压力大大减轻了,把负荷均衡地分配给了Web服务器,于是由原来的两层的Client/server结构转变成三层的Browser/Server结构。这种三层体系结构如下图所示。这种结构不仅把客户机从沉重的负担和不断对其提高的性能的要求中解放出来,也把技术维护人员从繁重的维护升级工作中解脱出来。由于客户机把事务处理逻辑部分分给了功能服务器,使客户机一下子“苗条”了许多,不再负责处理复杂计算和数据访问等关键事务,只负责显示部分,所以维护人员不再为程序的维护工作奔波于每个客户机之间,而把主要精力放在功能服务器上程序的更新工作。这种三层结构层与层之间相互独立,任何一层的改变不影响其它层的功能。它从根本上改变了传统的二层Client/Server体系结构的缺陷,它是应用系统体系结构中一次深刻的变革。两种体系结构的对比Browser/Server体系结构与Client/Server体系结构相比不仅具有Client/Server体系结构的全部优点,而且又有Clinet/Server体系结构所不具备的独特优势:开放的标准:Client/Server所采用的标准只要在内部统一就可,它的应用往往是专用的。Browser/Server所采用的标准都是开放的、非专用的,是经过标准化组织所确定的而非单一厂商所制定,保证了其应用的通用性和跨平台性。较低的开发和维护成本:Client/Server的应用必须开发出专用的客户端软件,无论是安装、配置还是升级都需要在所有的客户机上实施,极大地浪费了人力和物力。Browser/Server的应用只需在客户端装有通用的浏览器即可,维护和升级工作都在服务器端进行,不需对客户端进行任何改变,故而大大降低了开发和维护的成本。使用简单,界面友好:Client/Server用户的界面是由客户端软件所决定的,其使用的方法和界面各不相同,每推广一个Client/Server系统都要求用户从头学起,难以使用。Browser/Server用户的界面都统一在浏览器上,浏览器易于使用、界面友好,不须再学习使用其它的软件,一劳永逸的解决了用户的使用问题。客户端消肿:Client/Server的客户端具有显示与处理数据的功能,对客户端的要求很高,是一个“胖”客户机。Browser/Server的客户端不再负责数据库的存取和复杂数据计算的等任务,只需要其进行显示,充分发挥了服务器的强大作用,这样就大大的降低了对客户端的要求,客户端变得非常“瘦”。系统灵活:Client/Server系统的三部分模块中有一部分需改变就要关联到其它模块的变动,使系统极难升级。Browser/Server系统的三部分模块各自相对独立,其中一部分模块改变时其它模块不受影响,系统改进变得非常容易,且可以用不同厂家的产品来组成性能更佳的系统。保障系统的安全性:在Client/Server系统中由于客户机直接与数据库服务器进行连接,用户可以很轻易的改变服务器上的数据,无法保证系统的安全性。Browser/Server系统在客户机与数据库服务器之间增加了一层Web服务器,使两者不再直接相连,客户机无法直接对数据库操纵,有效地防止用户的非法入侵。三层的Browser/Server体系结构具有许多传统Client/Server体系结构不具备的优点,而且又紧密的结合了Internet/Intranet技术,是技术发展的大势所趋,它把应用系统带入了一个崭新的发展时代。由此我们选择B/S架构作为系统开发的体系结构。什么是C/S和B/S要想对“C/S”和“B/S”技术发展变化有所了解,首先必须搞清楚三个问题。(1) 什么是C/S结构。C/S (Client/Server)结构,即大家熟知的客户机和服务器结构。它是软件系统体系结构,通过它可以充分利用两端硬件环境的优势,将任务合理分配到Client端和Server端来实现,降低了系统的通讯开销。目前大多数应用软件系统都是Client/Server形式的两层结构,由于现在的软件应用系统正在向分布式的Web应用发展,Web和Client/Server 应用都可以进行同样的业务处理,应用不同的模块共享逻辑组件;因此,内部的和外部的用户都可以访问新的和现有的应用系统,通过现有应用系统中的逻辑可以扩展出新的应用系统。这也就是目前应用系统的发展方向。传统的CS体系结构虽然采用的是开放模式,但这只是系统开发一级的开放性,在特定的应用中无论是Client端还是Server端都还需要特定的软件支持。由于没能提供用户真正期望的开放环境,C/S结构的软件需要针对不同的操作系统系统开发不同版本的软件, 加之产品的更新换代十分快,已经很难适应百台电脑以上局域网用户同时使用。而且代价高, 效率低。如我院使用的上海超兰公司“案件统计”管理软件就是典型的CS体系结构管理软件。(1) 什么是B/S结构。B/S(Browser/Server)结构即浏览器和服务器结构。它是随着Internet技术的兴起,对C/S结构的一种变化或者改进的结构。在这种结构下,用户工作界面是通过WWW浏览器来实现,极少部分事务逻辑在前端(Browser)实现,但是主要事务逻辑在服务器端(Server)实现,形成所谓三层3-tier结构。这样就大大简化了客户端电脑载荷,减轻了系统维护与升级的成本和工作量,降低了用户的总体成本(TCO)。以目前的技术看,局域网建立B/S结构的网络应用,并通过Internet/Intranet模式下数据库应用,相对易于把握、成本也是较低的。它是一次性到位的开发,能实现不同的人员,从不同的地点,以不同的接入方式(比如LAN, WAN, Internet/Intranet等)访问和操作共同的数据库;它能有效地保护数据平台和管理访问权限,服务器数据库也很安全 。目前我院内网(Intranet)、外网(Internet)和北京东方清大公司“案件、办公管理软件”就是B/S 结构管理软件,干警在局域网各工作站通过WWW浏览器就能实现工作业务。特别是在JAVA这样的跨平台语言出现之后,B/S架构管理软件更是方便、快捷、高效。(3) 管理软件主流技术。管理软件技术的主流技术与管理思想一样,也经历了三个发展时期。首先,界面技术从上世纪DOS字符界面到Windows图形界面(或图形用户界面GUI),直至Browser浏览器界面三个不同的发展时期。其次,今天所有电脑的浏览器界面,不仅直观和易于使用,更主要的是基于浏览器平台的任何应用软件其风格都是一样的,使用人对操作培训的要求不高,而且软件可操作性强,易于识别;再者,平台体系结构也从过去单用户发展到今天的文件服务器(FS)体系、客户机服务器(CS)体系和浏览器服务器(BS)体系C/S和B/S 之比较C/S和B/S是当今世界开发模式技术架构的两大主流技术。C/S是美国 Borland公司最早研发,B/S是美国微软公司研发。目前,这两项技术以被世界各国所掌握,国内公司以C/S和B/S技术开发出产品也很多。这两种技术都有自己一定的市场份额和客户群,各家企业都说自己的管理软件架构技术功能强大、先进、方便,都能举出各自的客户群体,都有一大群文人墨客为自己摇旗呐喊,广告满天飞,可谓仁者见仁,智者见智C/S架构软件的优势与劣势 (1)应用服务器运行数据负荷较轻。最简单的C/S体系结构的数据库应用由两部分组成,即客户应用程序和数据库服务器程序。二者可分别称为前台程序与后台程序。运行数据库服务器程序的机器,也称为应用服务器。一旦服务器程序被启动,就随时等待响应客户程序发来的请求;客户应用程序运行在用户自己的电脑上,对应于数据库服务器,可称为客户电脑,当需要对数据库中的数据进行任何操作时,客户程序就自动地寻找服务器程序,并向其发出请求,服务器程序根据预定的规则作出应答,送回结果,应用服务器运行数据负荷较轻。(2)数据的储存管理功能较为透明。在数据库应用中,数据的储存管理功能,是由服务器程序和客户应用程序分别独立进行的,前台应用可以违反的规则,并且通常把那些不同的(不管是已知还是未知的)运行数据,在服务器程序中不集中实现,例如访问者的权限,编号可以重复、必须有客户才能建立定单这样的规则。所有这些,对于工作在前台程序上的最终用户,是“透明”的,他们无须过问(通常也无法干涉)背后的过程,就可以完成自己的一切工作。在客户服务器架构的应用中,前台程序不是非常“瘦小”,麻烦的事情都交给了服务器和网络。在C/S体系的下,数据库不能真正成为公共、专业化的仓库,它受到独立的专门管理。(3) C/S架构的劣势是高昂的维护成本且投资大。首先,采用C/S架构,要选择适当的数据库平台来实现数据库数据的真正“统一”,使分布于两地的数据同步完全交由数据库系统去管理,但逻辑上两地的操作者要直接访问同一个数据库才能有效实现,有这样一些问题,如果需要建立“实时”的数据同步,就必须在两地间建立实时的通讯连接,保持两地的数据库服务器在线运行,网络管理工作人员既要对服务器维护管理,又要对客户端维护和管理,这需要高昂的投资和复杂的技术支持,维护成本很高,维护任务量大。其次,传统的C/S结构的软件需要针对不同的操作系统系统开发不同版本的软件,由于产品的更新换代十分快,代价高和低效率已经不适应工作需要。在JAVA这样的跨平台语言出现之后,B/S架构更是猛烈冲击C/S,并对其形成威胁和挑战。B/S架构软件的优势与劣势(1)维护和升级方式简单。目前,软件系统的改进和升级越来越频繁,B/S架构的产品明显体现着更为方便的特性。对一个稍微大一点单位来说,系统管理人员如果需要在几百甚至上千部电脑之间来回奔跑,效率和工作量是可想而知的,但B/S架构的软件只需要管理服务器就行了,所有的客户端只是浏览器,根本不需要做任何的维护。无论用户的规模有多大,有多少分支机构都不会增加任何维护升级的工作量,所有的操作只需要针对服务器进行;如果是异地,只需要把服务器连接专网即可,实现远程维护、升级和共享。所以客户机越来越“瘦”,而服务器越来越“胖”是将来信息化发展的主流方向。今后,软件升级和维护会越来越容易,而使用起来会越来越简单,这对用户人力、物力、时间、费用的节省是显而易见的,惊人的。因此,维护和升级革命的方式是“瘦”客户机,“胖”服务器。(2)成本降低,选择更多。大家都知道windows在桌面电脑上几乎一统天下,浏览器成为了标准配置,但在服务器操作系统上windows并不是处于绝对的统治地位。 现在的趋势是凡使用B/S架构的应用管理软件,只需安装在Linux服务器上即可,而且安全性高。所以服务器操作系统的选择是很多的,不管选用那种操作系统都可以让大部分人使用windows作为桌面操作系统电脑不受影响,这就使的最流行免费的Linux操作系统快速发展起来,Linux除了操作系统是免费的以外,连数据库也是免费的,这种选择非常盛行。比如说很多人每天上“新浪”网,只要安装了浏览器就可以了,并不需要了解“新浪”的服务器用的是什么操作系统,而事实上大部分网站确实没有使用windows操作系统,但用户的电脑本身安装的大部分是windows操作系统。(3) 应用服务器运行数据负荷较重。由于B/S架构管理软件只安装在服务器端(Server)上,网络管理人员只需要管理服务器就行了,用户界面主要事务逻辑在服务器(Server)端完全通过WWW浏览器实现,极少部分事务逻辑在前端(Browser)实现,所有的客户端只有浏览器,网络管理人员只需要做硬件维护。但是,应用服务器运行数据负荷较重,一旦发生服务器“崩溃”等问题,后果不堪设想。因此,许多单位都备有数据库存储服务器,以防万一。外文翻译ENGLISHE:Develop Web application program using ASP the architecture that must first establish Web application. Now in application frequently with to have two: The architecture of C/S and the architecture of B/S. Client/server and customer end / server hold the architecture of C/S. The customer / server structure of two floor. Customer / server ( Client/Server ) model is a kind of good software architecture, it is the one of best application pattern of network. From technology, see that it is a logic concept, denote will a application many tasks of decomposing difference carry out , common completion is entire to apply the function of task. On each network main computer of web site, resource ( hardware, software and data ) divide into step, is not balanced, under customer / server structure, without the client computer of resource through sending request to the server that has resource , get resource request, so meet the resource distribution in network not balancedness. With this kind of structure, can synthesize various computers to cooperate with work, let it each can, realize the scale for the system of computer optimization ( Rightsizing ) with scale reduce to melt ( Downsizing ). Picture is as follows: It is most of to divide into computer network application into two, in which the resource and function that part supports many users to share , it is realized by server; Another part faces every user , is realized by client computer, also namely, client computer is usual to carry out proscenium function , realizes man-machine interaction through user interface , or is the application program of specific conducted user. And server usually carries out the function of backstage supporter , manages the outside request concerning seting up, accepting and replying user that shared. For a computer, it can have double function , is being certain and momentary to carve to act as server , and again becomes client computer in another time. Customer / server type computer divide into two kinds, one side who offers service is called as server , asks one side of service to be called as customer. To be able to offer service, server one side must have certain hardware and corresponding server software; Also, customer one side must also have certain hardware and corresponding customer software. There must be a agreement between server and customer, both sides communicate according to this agreement. Apply customer / server model in Internet service , the relation between customer and server is not immutable. Some Internet node offers service on the one hand , also gets service on the other hand from other node; It is even in one time dialogue course, mutual role also exchanges probably. As in carry out file transmission , if be called as one side who offers file server, is called as one side who gets file customer, when using get or mget order since another node takes file, can think that what self use and it is client computer , is using put or mput order to another node dispatch file can again think the machine that used self is server. Multilayer customer / server structure Along with the development of enterprise application, recently, have again arisen a kind of new multilayer architecture, it applies customer end to divide into two minutes: Customer application and server apply. Customer application is the part of original customer application , is another and partial to have been transfered to server to apply. New customer application takes the responsibility for user interface and simple regular business logic and new server application resident core , changeable business logic. Therefore its structure has become new ( Client application + Server application )/Server structure. Following picture shows: This kind of structure has solved traditional Client/Server can expand problem, have reduced customer end business logic , and have reduced the requirement of customer end for hardware. At the same time because of a lot of business logic concentrations have gone to unitary application server on, the maintenance work of application system had been also concentrated together, have eliminated the problem in the traditional structure of Client/Server that software distributes. This kind of structure is called as the architecture of B/S. Browser/Server and browser / server hold the architecture of B/S. On essence, Browser/Server is also a kind of structure of Client/Server, it is a kind of from the traditional two levels of structural development of Client/Server come to the three-layer structural special case of Client/Server that applied on Web. In the system of Browser/Server, user can pass through browser to a lot of servers that spread on network to send request. The structure of Browser/Server is maximum to have simplified the work of client computer, on client computer, need to install and deploy few customer end software only , server will bear more work, for database visit and apply program carry out will in server finish. Under the three-layer architecture of Browser/Server, express layer ( Presentatioon ) , function layer ( Business Logic ) , data layer ( Data Service ) have been cut the unit of 3 relative independences: It is the first layer of to express layer: Web browser. In expressing layer contain system show logic, locate in customer end. Its task is to suggest by Web browser to the certain a Web server on network that service is asked , after verifying for user identity, Web server delivers needed homepage with HTTP agreement to customer end, client computer accept the homepage file that passed , and show it in Web browser on. Second layer function layer: Have the Web server of the application function of program extension. In function layer contain the systematic handling of general affairs logic, locate in Web server end. Its task is the request concerning accepting user , need to be first conducted and corresponding to expand application program and database to carry out connection , passes through the waies such as SQL to database server to put forward data handling to apply for, then etc. database server the result of handling data submit to Web server, deliver again by Web server to return customer end. The number of plies of 3th according to layer: Database server. In data layer contain systematic data handling logic, locate in database server end. Its task is to accept the request that Web server controls for database, realization is inquired and modified for database , update etc. function, submit operation result to Web server. Careful analysis is been easy to see , the architecture of Browser/Server of three-layer is the handling of general affairs of the two levels of structure of Client/Server logic modular from the task of client computer in split , from the first floor of individual composition bear the pressure of its task and such client computer have alleviated greatly, distribute load balancedly and have given Web server, so from the structural change of Client/server of original two floor the structure of Browser/Server of three-layer. This kind of three-layer architecture following picture shows. This kind of structure not only client computer from heavy burden and the requirement of performance that rises continuously for it in liberation come out , also defend technology people from heavy maintenance upgrading work in free oneself. Since client computer handles general affairs , logic partial minutes have given function server, make client computer right off slender a lot of, do not take the responsibility for handling complex calculation and data again visit etc. crucial general affairs, is responsible to show part, so, maintenance people do not rush about again for the maintenance work of program between every client computer, and put major energy in the program on function server update work. Between this kind of three-layer structural layer and layer, the mutually independent change of any first floor does not affect the function of other layer. It has changed the defect of the two levels of architecture of Client/Server of tradition from foundation, it is the transform with deep once in application systematic architecture. The contrast of two architecturesThe architecture of Browser/Server and the architecture of Client/Server compare with all advantages that not only have the architecture of Client/Server and also have the architecture of Clinet/Server the unique advantage that place does not have: Open standard: The standard adopted by Client/Server only in department unification for but, its application is often for special purpose. It is lower to develop and defend cost: It need to be implemented on all client computers that the application of Client/Server must develop the customer end software for special purpose, no matter installation and disposition escalate still, have wasted manpower and material resources maximumly. The application of Browser/Server need in customer end have general browser , defend and escalate to work in server end go on , need not carry out any change as customer holds , have reduced the cost of development and maintenance so greatly. It is simple to use , interface friendly: The interface of the user of Client/Server is decided by customer end software, interface and the method of its use are not identical each, per popularize a system of Client/Server ask user study from the beginning, is hard to use. The interface of the user of Browser/Server is unified on browser, browser is easy to use , interface friendly, must not study use again other software, the use of a Lao Yong Yi that has solved user problem. Customer end detumescence: The customer end of Client/Server has the function that shows and handles data , as the requirement of customer end is a client computer it is fat very high. The customer of Browser/Server holds the access that not takes the responsibility for database again and the etc. task of complex data calculation, need it only show , the powerful role that has played server fully is so large to have reduced the requirement for customer end, customer end become very thin . System is flexible: The 3 minutes of the system of Client/Server, in modular, have the part that need to change to want relation to the change of other modular, make system very difficult upgrading. The 3 minutes of the system of Browser/Server modular relative independence, in which a part of modular change, other modular does not get influence, it is very easy that system improve to become, and can form the system with much better performance with the product of different manufacturer. Ensure systematic safety: In the system of Client/Server, directly join with database server because of client computer, user can very easily change the data on server, can not guarantee systematic safety. T
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论