英语文献翻译网上商城JAVA.docx

上传人:b****5 文档编号:8633269 上传时间:2023-02-01 格式:DOCX 页数:16 大小:63.30KB
下载 相关 举报
英语文献翻译网上商城JAVA.docx_第1页
第1页 / 共16页
英语文献翻译网上商城JAVA.docx_第2页
第2页 / 共16页
英语文献翻译网上商城JAVA.docx_第3页
第3页 / 共16页
英语文献翻译网上商城JAVA.docx_第4页
第4页 / 共16页
英语文献翻译网上商城JAVA.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

英语文献翻译网上商城JAVA.docx

《英语文献翻译网上商城JAVA.docx》由会员分享,可在线阅读,更多相关《英语文献翻译网上商城JAVA.docx(16页珍藏版)》请在冰豆网上搜索。

英语文献翻译网上商城JAVA.docx

英语文献翻译网上商城JAVA

毕业设计(论文)外文翻译

 

题目:

基于Java的网上商城系统的设计与实现

 

院(系):

计算机科学与工程

专业:

网络工程

班级:

070607

学生:

冯宁

学号:

*********

******

2011年05月09日

EnglishOnly

JavaandtheInternet

IfJavais,infact,yetanothercomputerprogramminglanguage,youmayquestionwhyitissoimportantandwhyitisbeingpromotedasarevolutionarystepincomputerprogramming.Theanswerisn’timmediatelyobviousifyou’recomingfromatraditionalprogrammingperspective.AlthoughJavaisveryusefulforsolvingtraditionalstandaloneprogrammingproblems,itisalsoimportantbecauseitwillsolveprogrammingproblemsontheWorldWideWeb.

WhatistheWeb?

TheWebcanseemabitofamysteryatfirst,withallthistalkof“surfing,”“presence,”and“homepages.”It’shelpfultostepbackandseewhatitreallyis,buttodothisyoumustunderstandclient/serversystems,anotheraspectofcomputingthat’sfullofconfusingissues.

1.Client/Servercomputing

Theprimaryideaofaclient/serversystemisthatyouhaveacentralrepositoryofinformation—somekindofdata,ofteninadatabase—thatyouwanttodistributeondemandtosomesetofpeopleormachines.Akeytotheclient/serverconceptisthattherepositoryofinformationiscentrallylocatedsothatitcanbechangedandsothatthosechangeswillpropagateouttotheinformationconsumers.Takentogether,theinformationrepository,thesoftwarethatdistributestheinformation,andthemachine(s)wheretheinformationandsoftwareresideiscalledtheserver.Thesoftwarethatresidesontheremotemachine,communicateswiththeserver,fetchestheinformation,processesit,andthendisplaysitontheremotemachineiscalledtheclient.

Thebasicconceptofclient/servercomputing,then,isnotsocomplicated.Theproblemsarisebecauseyouhaveasingleservertryingtoservemanyclientsatonce.Generally,adatabasemanagementsystemisinvolved,sothedesigner“balances”thelayoutofdataintotablesforoptimaluse.Inaddition,systemsoftenallowaclienttoinsertnewinformationintoaserver.Thismeansyoumustensurethatoneclient’snewdatadoesn’twalkoveranotherclient’snewdata,orthatdataisn’tlostintheprocessofaddingittothedatabase(thisiscalledtransactionprocessing).Asclientsoftwarechanges,itmustbebuilt,debugged,andinstalledontheclientmachines,whichturnsouttobemorecomplicatedandexpensivethanyoumightthink.It’sespeciallyproblematictosupportmultipletypesofcomputersandoperatingsystems.Finally,there’stheall-importantperformanceissue:

Youmighthavehundredsofclientsmakingrequestsofyourserveratanyonetime,soanysmalldelayiscrucial.Tominimizelatency,programmersworkhardtooffloadprocessingtasks,oftentotheclientmachine,butsometimestoothermachinesattheserversite,usingso-calledmiddleware.(Middlewareisalsousedtoimprovemaintainability.)

Thesimpleideaofdistributinginformationhassomanylayersofcomplexitythatthewholeproblemcanseemhopelesslyenigmatic.Andyetit’scrucial:

Client/servercomputingaccountsforroughlyhalfofallprogrammingactivities.It’sresponsibleforeverythingfromtakingordersandcredit-cardtransactionstothedistributionofanykindofdata—stockmarket,scientific,government,younameit.Whatwe’vecomeupwithinthepastisindividualsolutionstoindividualproblems,inventinganewsolutioneachtime.Thesewerehardtocreateandhardtouse,andtheuserhadtolearnanewinterfaceforeachone.Theentireclient/serverproblemneedstobesolvedinabigway.

2.TheWebasagiantserver

TheWebisactuallyonegiantclient/serversystem.It’sabitworsethanthat,sinceyouhavealltheserversandclientscoexistingonasinglenetworkatonce.Youdon’tneedtoknowthat,becauseallyoucareaboutisconnectingtoandinteractingwithoneserveratatime(eventhoughyoumightbehoppingaroundtheworldinyoursearchforthecorrectserver).

Initiallyitwasasimpleone-wayprocess.Youmadearequestofaserverandithandedyouafile,whichyourmachine’sbrowsersoftware(i.e.,theclient)wouldinterpretbyformattingontoyourlocalmachine.Butinshortorderpeoplebeganwantingtodomorethanjustdeliverpagesfromaserver.Theywantedfullclient/servercapabilitysothattheclientcouldfeedinformationbacktotheserver,forexample,tododatabaselookupsontheserver,toaddnewinformationtotheserver,ortoplaceanorder(whichrequiredmoresecuritythantheoriginalsystemsoffered).Thesearethechangeswe’vebeenseeinginthedevelopmentoftheWeb.

TheWebbrowserwasabigstepforward:

theconceptthatonepieceofinformationcouldbedisplayedonanytypeofcomputerwithoutchange.However,browserswerestillratherprimitiveandrapidlyboggeddownbythedemandsplacedonthem.Theyweren’tparticularlyinteractive,andtendedtoclogupboththeserverandtheInternetbecauseanytimeyouneededtodosomethingthatrequiredprogrammingyouhadtosendinformationbacktotheservertobeprocessed.Itcouldtakemanysecondsorminutestofindoutyouhadmisspelledsomethinginyourrequest.Sincethebrowserwasjustavieweritcouldn’tperformeventhesimplestcomputingtasks.(Ontheotherhand,itwassafe,becauseitcouldn’texecuteanyprogramsonyourlocalmachinethatmightcontainbugsorviruses.)

Tosolvethisproblem,differentapproacheshavebeentaken.Tobeginwith,graphicsstandardshavebeenenhancedtoallowbetteranimationandvideowithinbrowsers.Theremainderoftheproblemcanbesolvedonlybyincorporatingtheabilitytorunprogramsontheclientend,underthebrowser.Thisiscalledclient-sideprogramming.

Client-sideprogramming

TheWeb’sinitialserver-browserdesignprovidedforinteractivecontent,buttheinteractivitywascompletelyprovidedbytheserver.Theserverproducedstaticpagesfortheclientbrowser,whichwouldsimplyinterpretanddisplaythem.BasicHyperTextMarkupLanguage(HTML)containssimplemechanismsfordatagathering:

text-entryboxes,checkboxes,radioboxes,listsanddrop-downlists,aswellasabuttonthatcanonlybeprogrammedtoresetthedataontheformor“submit”thedataontheformbacktotheserver.ThissubmissionpassesthroughtheCommonGatewayInterface(CGI)providedonallWebservers.ThetextwithinthesubmissiontellsCGIwhattodowithit.Themostcommonactionistorunaprogramlocatedontheserverinadirectorythat’stypicallycalled“cgi-bin.”(IfyouwatchtheaddresswindowatthetopofyourbrowserwhenyoupushabuttononaWebpage,youcansometimessee“cgi-bin”withinallthegobbledygookthere.)Theseprogramscanbewritteninmostlanguages.Perlhasbeenacommonchoicebecauseitisdesignedfortextmanipulationandisinterpreted,soitcanbeinstalledonanyserverregardlessofprocessororoperatingsystem.However,Python(myfavorite—seewww.Python.org)hasbeenmakinginroadsbecauseofitsgreaterpowerandsimplicity.

ManypowerfulWebsitestodayarebuiltstrictlyonCGI,andyoucaninfactdonearlyanythingwithCGI.However,WebsitesbuiltonCGIprogramscanrapidlybecomeoverlycomplicatedtomaintain,andthereisalsotheproblemofresponsetime.TheresponseofaCGIprogramdependsonhowmuchdatamustbesent,aswellastheloadonboththeserverandtheInternet.(Ontopofthis,startingaCGIprogramtendstobeslow.)TheinitialdesignersoftheWebdidnotforeseehowrapidlythisbandwidthwouldbeexhaustedforthekindsofapplicationspeopledeveloped.Forexample,anysortofdynamicgraphingisnearlyimpossibletoperformwithconsistencybecauseaGraphicsInterchangeFormat(GIF)filemustbecreatedandmovedfromtheservertotheclientforeachversionofthegraph.Andyou’venodoubthaddirectexperiencewithsomethingassimpleasvalidatingthedataonaninputform.Youpressthesubmitbuttononapage;thedataisshippedbacktotheserver;theserverstartsaCGIprogramthatdiscoversanerror,formatsanHTMLpageinformingyouoftheerror,andthensendsthepagebacktoyou;youmustthenbackupapageandtryagain.Notonlyisthisslow,it’sinelegant.

Thesolutionisclient-sideprogramming.MostmachinesthatrunWebbrowsersarepowerfulenginescapableofdoingvastwork,andwiththeoriginalstaticHTMLapproachtheyaresittingthere,justidlywaitingfortheservertodishupthenextpage.Client-sideprogrammingmeansthattheWebbrowserisharnessedtodowhateverworkitcan,andtheresultfortheuserisamuchspeedierandmoreinteractiveexperienceatyourWebsite.

Theproblemwithdiscussionsofclient-sideprogrammingisthattheyaren’tverydifferentfromdiscussionsofprogrammingingeneral.Theparametersarealmostthesame,buttheplatformisdifferent;aWebbrowserislikealimitedoperatingsystem.Intheend,youmuststillprogram,andthisaccountsforthedizzyingarrayofproblemsandsolutionsproducedbyclient-sideprogramming.Therestofthissectionprovidesanoverviewoftheissuesandapproachesinclient-sideprogramming.

1.Plug-ins

Oneofthemostsignificantstepsforwardinclient-sideprogrammingisthedevelopmentoftheplug-in.Thisisawayforaprogrammertoaddnewfunctionalitytothebrowserbydownloadingapieceofcodethatplugsitselfintotheappropriatespotinthebrowser.Ittellsthebrowser“fromnowonyoucanperformthisnewactivity.”(Youneedtodownloadtheplug-inonlyonce.)Somefastandpowerfulbehaviorisaddedtobrowsersviaplug-ins,butwritingaplug-inisnotatrivialtask,andisn’tsomethingyou’dwanttodoaspartoftheprocessofbuildingaparticularsite.Thevalueoftheplug-info

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1