版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p><b> 西安郵電大學(xué)</b></p><p> 畢 業(yè) 設(shè) 計(jì)(論 文)</p><p><b> 外文文獻(xiàn)翻譯</b></p><p> 院 (系): 計(jì)算機(jī)學(xué)院 </p><p> 專 業(yè): 計(jì)算機(jī)科學(xué)與
2、技術(shù) </p><p> 班 級(jí): </p><p> 學(xué)生姓名: </p><p> 導(dǎo)師姓名: 職稱: </p><p> 起止時(shí)間:2011年 9月23日 至 2012年 6月2日&l
3、t;/p><p><b> 原文:</b></p><p> Java and the Internet</p><p> Although Java is very useful for solving traditional stand-alone programming problems, it is also important be
4、cause it will solve programming problems on the World Wide Web.</p><p> Client-side programming</p><p> The Web’s initial server-browser design provided for interactive content, but the intera
5、ctivity was completely provided by the server. The server produced static pages for the client browser, which would simply interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry
6、boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server. T</p><p> Many
7、powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the proble
8、m of response time. The response of a CGI program depends on how much data must be sent, as well as the load on both the server and the Internet. (On top of this, starting a CGI program tends to be slow.) The initial des
9、igners of the Web did not foresee how rapidly this band</p><p> The solution is client-side programming. Most machines that run Web browsers are powerful engines capable of doing vast work, and with the ori
10、ginal static HTML approach they are sitting there, just idly waiting for the server to dish up the next page. Client-side programming means that the Web browser is harnessed to do whatever work it can, and the result for
11、 the user is a much speedier and more interactive experience at your Web site.</p><p> The problem with discussions of client-side programming is that they aren’t very different from discussions of programm
12、ing in general. The parameters are almost the same, but the platform is different: a Web browser is like a limited operating system. In the end, you must still program, and this accounts for the dizzying array of problem
13、s and solutions produced by client-side programming. The rest of this section provides an overview of the issues and approaches in client-side programming.</p><p> 2.Plug-ins</p><p> One of th
14、e most significant steps forward in client-side programming is the development of the plug-in. This is a way for a programmer to add new functionality to the browser by downloading a piece of code that plugs itself into
15、the appropriate spot in the browser. It tells the browser “from now on you can perform this new activity.” (You need to download the plug-in only once.) Some fast and powerful behavior is added to browsers via plug-ins,
16、but writing a plug-in is not a trivial task, and is</p><p> 3.Scripting languages</p><p> Plug-ins resulted in an explosion of scripting languages. With a scripting language you embed the sour
17、ce code for your client-side program directly into the HTML page, and the plug-in that interprets that language is automatically activated while the HTML page is being displayed. Scripting languages tend to be reasonably
18、 easy to understand and, because they are simply text that is part of an HTML page, they load very quickly as part of the single server hit required to procure that page. The tra</p><p> This points out tha
19、t the scripting languages used inside Web browsers are really intended to solve specific types of problems, primarily the creation of richer and more interactive graphical user interfaces (GUIs). However, a scripting lan
20、guage might solve 80 percent of the problems encountered in client-side programming. Your problems might very well fit completely within that 80 percent, and since scripting languages can allow easier and faster developm
21、ent, you should probably consider a scrip</p><p> The most commonly discussed browser scripting languages are JavaScript (which has nothing to do with Java; it’s named that way just to grab some of Java’s m
22、arketing momentum), VBScript (which looks like Visual Basic), and Tcl/Tk, which comes from the popular cross-platform GUI-building language. There are others out there, and no doubt more in development.</p><p&
23、gt; JavaScript is probably the most commonly supported. It comes built into both Netscape Navigator and the Microsoft Internet Explorer (IE). In addition, there are probably more JavaScript books available than there ar
24、e for the other browser languages, and some tools automatically create pages using JavaScript. However, if you’re already fluent in Visual Basic or Tcl/Tk, you’ll be more productive using those scripting languages rather
25、 than learning a new one. (You’ll have your hands full dealing wi</p><p><b> 4.Java</b></p><p> If a scripting language can solve 80 percent of the client-side programming problems
26、, what about the other 20 percent—the “really hard stuff?” The most popular solution today is Java. Not only is it a powerful programming language built to be secure, cross-platform, and international, but Java is being
27、continually extended to provide language features and libraries that elegantly handle problems that are difficult in traditional programming languages, such as multithreading, database access, net</p><p> A
28、n applet is a mini-program that will run only under a Web browser. The applet is downloaded automatically as part of a Web page (just as, for example, a graphic is automatically downloaded). When the applet is activated
29、it executes a program. This is part of its beauty—it provides you with a way to automatically distribute the client software from the server at the time the user needs the client software, and no sooner. The user gets th
30、e latest version of the client software without fail and wi</p><p> One advantage a Java applet has over a scripted program is that it’s in compiled form, so the source code isn’t available to the client. O
31、n the other hand, a Java applet can be decompiled without too much trouble, but hiding your code is often not an important issue. Two other factors can be important. As you will see later in this book, a compiled Java ap
32、plet can comprise many modules and take multiple server “hits” (accesses) to download. (In Java 1.1 and higher this is minimized by Java archi</p><p><b> 5.ActiveX</b></p><p> To s
33、ome degree, the competitor to Java is Microsoft’s ActiveX, although it takes a completely different approach. ActiveX was originally a Windows-only solution, although it is now being developed via an independent consorti
34、um to become cross-platform. Effectively, ActiveX says “if your program connects to its environment just so, it can be dropped into a Web page and run under a browser that supports ActiveX.” (IE directly supports ActiveX
35、 and Netscape does so using a plug-in.) Thus, ActiveX do</p><p> 6.Internet vs. intranet</p><p> The Web is the most general solution to the client/server problem, so it makes sense that you c
36、an use the same technology to solve a subset of the problem, in particular the classic client/server problem within a company. With traditional client/server approaches you have the problem of multiple types of client co
37、mputers, as well as the difficulty of installing new client software, both of which are handily solved with Web browsers and client-side programming. When Web technology is used for an </p><p> The security
38、 problem brings us to one of the divisions that seems to be automatically forming in the world of client-side programming. If your program is running on the Internet, you don’t know what platform it will be working under
39、, and you want to be extra careful that you don’t disseminate buggy code. You need something cross-platform and secure, like a scripting language or Java. </p><p> If you’re running on an intranet, you migh
40、t have a different set of constraints. It’s not uncommon that your machines could all be Intel/Windows platforms. On an intranet, you’re responsible for the quality of your own code and can repair bugs when they’re disco
41、vered. In addition, you might already have a body of legacy code that you’ve been using in a more traditional client/server approach, whereby you must physically install client programs every time you do an upgrade. The
42、time wasted in ins</p><p> When faced with this bewildering array of solutions to the client-side programming problem, the best plan of attack is a cost-benefit analysis. Consider the constraints of your pr
43、oblem and what would be the shortest path to your solution. Since client-side programming is still programming, it’s always a good idea to take the fastest development approach for your particular situation. This is an a
44、ggressive stance to prepare for inevitable encounters with the problems of program development.</p><p><b> 翻譯:</b></p><p><b> Java和因特網(wǎng)</b></p><p> Java除了可
45、解決傳統(tǒng)的程序設(shè)計(jì)問題以外,還能解決World Wide Web(萬維網(wǎng))上的編程問題。</p><p><b> 1.客戶端編程</b></p><p> Web最初采用的“服務(wù)器-瀏覽器”方案可提供交互式內(nèi)容,但這種交互能力完全由服務(wù)器提供,為服務(wù)器和因特網(wǎng)帶來了不小的負(fù)擔(dān)。服務(wù)器一般為客戶瀏覽器產(chǎn)生靜態(tài)網(wǎng)頁,由后者簡(jiǎn)單地解釋并顯示出來?;綡TML語言提供了
46、簡(jiǎn)單的數(shù)據(jù)收集機(jī)制:文字輸入框、復(fù)選框、單選鈕、列表以及下拉列表等,另外還有一個(gè)按鈕,只能由程序規(guī)定重新設(shè)置表單中的數(shù)據(jù),以便回傳給服務(wù)器。用戶提交的信息通過所有Web服務(wù)器均能支持的“通用網(wǎng)關(guān)接口”(CGI)回傳到服務(wù)器。包含在提交數(shù)據(jù)中的文字指示CGI該如何操作。最常見的行動(dòng)是運(yùn)行位于服務(wù)器的一個(gè)程序。那個(gè)程序一般保存在一個(gè)名為“cgi-bin”的目錄中(按下Web頁內(nèi)的一個(gè)按鈕時(shí),請(qǐng)注意一下瀏覽器頂部的地址窗,經(jīng)常都能發(fā)現(xiàn)“cgi
47、-bin”的字樣)。大多數(shù)語言都可用來編制這些程序,但其中最常見的是Perl。這是由于Perl是專為文字的處理及解釋而設(shè)計(jì)的,所以能在任何服務(wù)器上安裝和使用,無論采用的處理器或操作系統(tǒng)是什么。</p><p><b> 2. 插件</b></p><p> 朝客戶端編程邁進(jìn)的時(shí)候,最重要的一個(gè)問題就是插件的設(shè)計(jì)。利用插件,程序員可以方便地為瀏覽器添加新功能,用戶只
48、需下載一些代碼,把它們“插入”瀏覽器的適當(dāng)位置即可。這些代碼的作用是告訴瀏覽器“從現(xiàn)在開始,你可以進(jìn)行這些新活動(dòng)了”(僅需下載這些插入一次)。有些快速和功能強(qiáng)大的行為是通過插件添加到瀏覽器的。但插件的編寫并不是一件簡(jiǎn)單的任務(wù)。在我們構(gòu)建一個(gè)特定的站點(diǎn)時(shí),可能并不希望涉及這方面的工作。對(duì)客戶端程序設(shè)計(jì)來說,插件的價(jià)值在于它允許專業(yè)程序員設(shè)計(jì)出一種新的語言,并將那種語言添加到瀏覽器,同時(shí)不必經(jīng)過瀏覽器原創(chuàng)者的許可。由此可以看出,插件實(shí)際是瀏
49、覽器的一個(gè)“后門”,允許創(chuàng)建新的客戶端程序設(shè)計(jì)語言(盡管并非所有語言都是作為插件實(shí)現(xiàn)的)。</p><p><b> 3. 腳本編制語言</b></p><p> 插件造成了腳本編制語言的爆炸性增長(zhǎng)。通過這種腳本語言,可將用于自己客戶端程序的源碼直接插入HTML頁,而對(duì)那種語言進(jìn)行解釋的插件會(huì)在HTML頁顯示的時(shí)候自動(dòng)激活。腳本語言一般都傾向于盡量簡(jiǎn)化,易于理解。
50、而且由于它們是從屬于HTML頁的一些簡(jiǎn)單正文,所以只需向服務(wù)器發(fā)出對(duì)那個(gè)頁的一次請(qǐng)求,即可非??斓剌d入。缺點(diǎn)是我們的代碼全部暴露在人們面前。另一方面,由于通常不用腳本編制語言做過分復(fù)雜的事情,所以這個(gè)問題暫且可以放在一邊。</p><p> 腳本語言真正面向的是特定類型問題的解決,其中主要涉及如何創(chuàng)建更豐富、更具有互動(dòng)能力的圖形用戶界面(GUI)。然而,腳本語言也許能解決客戶端編程中80%的問題。你碰到的問題可
51、能完全就在那80%里面。而且由于腳本編制語言的宗旨是盡可能地簡(jiǎn)化與快速,所以在考慮其他更復(fù)雜的方案之前(如Java及ActiveX),首先應(yīng)想一下腳本語言是否可行。</p><p> 目前討論得最多的腳本編制語言包括JavaScript(它與Java沒有任何關(guān)系;之所以叫那個(gè)名字,完全是一種市場(chǎng)策略)、VBScript(同Visual Basic很相似)以及Tcl/Tk(來源于流行的跨平臺(tái)GUI構(gòu)造語言)。當(dāng)然
52、還有其他許多語言,也有許多正在開發(fā)中。</p><p> JavaScript也許是日常用的,它得到的支持也最全面。無論NetscapeNavigator,Microsoft Internet Explorer,還是Opera,目前都提供了對(duì)JavaScript的支持。除此以外,市面上講述JavaScript的書籍也要比講述其他語言的書多得多。有些工具還能利用JavaScript自動(dòng)產(chǎn)生網(wǎng)頁。當(dāng)然,如果你已經(jīng)有
53、Visual Basic或者Tcl/Tk的深厚功底,當(dāng)然用它們要簡(jiǎn)單得多,起碼可以避免學(xué)習(xí)新語言的煩惱(解決Web方面的問題就已經(jīng)夠讓人頭痛了)。</p><p><b> 4. Java</b></p><p> 如果說一種腳本編制語言能解決80%的客戶端程序設(shè)計(jì)問題,那么剩下的20%又該怎么辦呢?它們屬于一些高難度的問題嗎?目前最流行的方案就是Java。它不僅
54、是一種功能強(qiáng)大、高度安全、可以跨平臺(tái)使用以及國際通用的程序設(shè)計(jì)語言,也是一種具有旺盛生命力的語言。對(duì)Java的擴(kuò)展是不斷進(jìn)行的,提供的語言特性和庫能夠很好地解決傳統(tǒng)語言不能解決的問題,比如多線程操作、數(shù)據(jù)庫訪問、連網(wǎng)程序設(shè)計(jì)以及分布式計(jì)算等等。Java通過“程序片”(Applet)巧妙地解決了客戶端編程的問題。</p><p> 程序片(或“小應(yīng)用程序”)是一種非常小的程序,只能在Web瀏覽器中運(yùn)行。作為Web
55、頁的一部分,程序片代碼會(huì)自動(dòng)下載回來(這和網(wǎng)頁中的圖片差不多)。激活程序片后,它會(huì)執(zhí)行一個(gè)程序。程序片的一個(gè)優(yōu)點(diǎn)體現(xiàn)在:通過程序片,一旦用戶需要客戶軟件,軟件就可從服務(wù)器自動(dòng)下載回來。它們能自動(dòng)取得客戶軟件的最新版本,不會(huì)出錯(cuò),也沒有重新安裝的麻煩。由于Java的設(shè)計(jì)原理,程序員只需要?jiǎng)?chuàng)建程序的一個(gè)版本,那個(gè)程序能在幾乎所有計(jì)算機(jī)以及安裝了Java解釋器的瀏覽器中運(yùn)行。由于Java是一種全功能的編程語言,所以在向服務(wù)器發(fā)出一個(gè)請(qǐng)求之前,
56、我們能先在客戶端做完盡可能多的工作。例如,再也不必通過因特網(wǎng)傳送一個(gè)請(qǐng)求表單,再由服務(wù)器確定其中是否存在一個(gè)拼寫或者其他參數(shù)錯(cuò)誤。大多數(shù)數(shù)據(jù)校驗(yàn)工作均可在客戶端完成,沒有必要坐在計(jì)算機(jī)前面焦急地等待服務(wù)器的響應(yīng)。這樣一來,不僅速度和響應(yīng)的靈敏度得到了極大的提高,對(duì)網(wǎng)絡(luò)和服務(wù)器造成的負(fù)擔(dān)也可以明顯減輕,這對(duì)保障因特網(wǎng)的暢通是至關(guān)重要的。 與腳本程序相比,Java程序片的另一個(gè)優(yōu)點(diǎn)是它采用編譯好的形式,所以客戶端看不到源碼。當(dāng)然在另
57、一方面,反編譯Java程序片也并不是件</p><p> 5. ActiveX</p><p> 在某種程度上,Java的一個(gè)有力競(jìng)爭(zhēng)對(duì)手應(yīng)該是微軟的ActiveX,盡管它采用的是完全不同的一套實(shí)現(xiàn)機(jī)制。ActiveX最早是一種純Windows的方案。經(jīng)過一家獨(dú)立的專業(yè)協(xié)會(huì)的努力,ActiveX現(xiàn)在已具備了跨平臺(tái)使用的能力。實(shí)際上,ActiveX的意思是“假如你的程序同它的工作環(huán)境正常
58、連接,它就能進(jìn)入Web頁,并在支持ActiveX的瀏覽器中運(yùn)行”(IE固化了對(duì)ActiveX的支持,而Netscape需要一個(gè)插件)。所以,ActiveX并沒有限制我們使用一種特定的語言。比如,假設(shè)我們已經(jīng)是一名有經(jīng)驗(yàn)的Windows程序員,能熟練地使用像C++、Visual Basic或者Borland Delphi那樣的語言,就能幾乎不加任何學(xué)習(xí)地創(chuàng)建出ActiveX組件。事實(shí)上,ActiveX是在我們的Web頁中使用“歷史遺留”代
59、碼的最佳途徑。</p><p> 6. 因特網(wǎng)和內(nèi)聯(lián)網(wǎng)</p><p> Web是解決客戶機(jī)/服務(wù)器問題的一種常用方案,所以最好能用相同的技術(shù)解決此類問題的一些“子集”,特別是公司內(nèi)部的傳統(tǒng)客戶機(jī)/服務(wù)器問題。對(duì)于傳統(tǒng)的客戶機(jī)/服務(wù)器模式,我們面臨的問題是擁有多種不同類型的客戶計(jì)算機(jī),而且很難安裝新的客戶軟件。但通過Web瀏覽器和客戶端編程,這兩類問題都可得到很好的解決。若一個(gè)信息網(wǎng)絡(luò)
60、局限于一家特定的公司,那么在將Web技術(shù)應(yīng)用于它之后,即可稱其為“內(nèi)聯(lián)網(wǎng)”(Intranet),以示與國際性的“因特網(wǎng)”(Internet)有別。內(nèi)聯(lián)網(wǎng)提供了比因特網(wǎng)更高的安全級(jí)別,因?yàn)榭梢晕锢硇缘乜刂茖?duì)公司內(nèi)部服務(wù)器的使用。說到培訓(xùn),一般只要人們理解了瀏覽器的常規(guī)概念,就可以非常輕松地掌握網(wǎng)頁和程序片之間的差異,所以學(xué)習(xí)新型系統(tǒng)的開銷會(huì)大幅度減少。</p><p> 安全問題將我們引入客戶端編程領(lǐng)域一個(gè)似乎是
61、自動(dòng)形成的分支。若程序是在因特網(wǎng)上運(yùn)行,由于無從知曉它會(huì)在什么平臺(tái)上運(yùn)行,所以編程時(shí)要特別留意,防范可能出現(xiàn)的編程錯(cuò)誤。需作一些跨平臺(tái)處理,以及適當(dāng)?shù)陌踩婪?,比如采用某種腳本語言或者Java。</p><p> 但假如在內(nèi)聯(lián)網(wǎng)中運(yùn)行,面臨的一些制約因素就會(huì)發(fā)生變化。全部機(jī)器均為Intel/Windows平臺(tái)是件很平常的事情。在內(nèi)聯(lián)網(wǎng)中,需要對(duì)自己代碼的質(zhì)量負(fù)責(zé)。而且一旦發(fā)現(xiàn)錯(cuò)誤,就可以馬上改正。除此以外,可能
62、已經(jīng)有了一些“歷史遺留”的代碼,并用較傳統(tǒng)的客戶機(jī)/服務(wù)器方式使用那些代碼。但在進(jìn)行升級(jí)時(shí),每次都要物理性地安裝一道客戶程序。浪費(fèi)在升級(jí)安裝上的時(shí)間是轉(zhuǎn)移到瀏覽器的一項(xiàng)重要原因。使用了瀏覽器后,升級(jí)就變得易如反掌,而且整個(gè)過程是透明和自動(dòng)進(jìn)行的。如果真的是牽涉到這樣的一個(gè)內(nèi)聯(lián)網(wǎng)中,最明智的方法是采用ActiveX,而非試圖采用一種新的語言來改寫程序代碼。</p><p> 面臨客戶端編程問題令人困惑的一系列解決
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- [jsp畢設(shè)]my美食網(wǎng)站
- 應(yīng)用jsp,jsp,和tomcat進(jìn)行網(wǎng)站開發(fā)從新手到專業(yè)人員【外文翻譯】
- [jsp畢設(shè)]小區(qū)門戶網(wǎng)站
- [jsp畢設(shè)]jsp作業(yè)管理
- [jsp畢設(shè)]jsp在線學(xué)習(xí)系統(tǒng)
- [jsp畢設(shè)]jsp考試管理系統(tǒng)
- [jsp畢設(shè)]jsp教學(xué)管理系統(tǒng)
- [jsp畢設(shè)]jsp倉儲(chǔ)管理系統(tǒng)+論文
- jsp技術(shù)網(wǎng)站設(shè)計(jì)外文翻譯
- [jsp畢設(shè)]jsp網(wǎng)上書店系統(tǒng)
- 網(wǎng)站開發(fā)合同
- 網(wǎng)站開發(fā)合同
- 49畢設(shè)外文翻譯.docx
- 畢設(shè)外文翻譯格式doc
- [jsp畢設(shè)]jsp高校智能排課系統(tǒng)+論文
- 外文翻譯---jsp動(dòng)態(tài)網(wǎng)站技術(shù)
- [jsp畢設(shè)]jsp網(wǎng)上書店程序+論文
- 網(wǎng)站開發(fā)設(shè)計(jì)報(bào)告
- 網(wǎng)站開發(fā)服務(wù)合同
- [jsp畢設(shè)]企業(yè)電子投票系統(tǒng)
評(píng)論
0/150
提交評(píng)論