电子商务毕业论文外文翻译范文《JavaandtheInternet》.docx
《电子商务毕业论文外文翻译范文《JavaandtheInternet》.docx》由会员分享,可在线阅读,更多相关《电子商务毕业论文外文翻译范文《JavaandtheInternet》.docx(12页珍藏版)》请在冰豆网上搜索。
![电子商务毕业论文外文翻译范文《JavaandtheInternet》.docx](https://file1.bdocx.com/fileroot1/2023-1/5/73e6b878-e8de-465a-9db7-f7ae61636528/73e6b878-e8de-465a-9db7-f7ae616365281.gif)
电子商务毕业论文外文翻译范文《JavaandtheInternet》
外文文献:
JavaandtheInternet
IfJavais,infact,yetanothercomputerprogrammingIanguage,youmayquestionwhyitissoimportantandwhyitisbeingpromotedasarevolutionarystepincomputerprogramming.Theanswerisn'timmediatelyobviousifyou'recomingfromatraditionalprogrammingperspective.AlthoughJavaisveryusefulforsolvingtraditionalstand-aloneprogrammingproblems,itisalsoimportantbecauseitwillsolveprogrammingproblemsontheWorldWideWeb.
1.Client-sideprogramming
TheWeb'sinitialserver-browserdesignprovidedforinteractivecontent,buttheinteractivitywascompletelyprovidedbytheserver.Theserverproducedstaticpagesfortheclientbrowser,whichwouldsimplyinterpretanddisplaythem.BasicHTMLcontainssimplemechanismsfordatagathering:
text-entryboxes,checkboxes,radioboxes,listsanddrop-downlists,aswellasabuttonthatcanonlybeprogrammedtoresetthedataontheformorsubmit”thedataontheformbacktotheserver.ThissubmissionpassesthroughtheCommonGatewayInterface(CGI)providedonallWebservers.ThetextwithinthesubmissiontellsCGIwhattodowithit.Themostcommonactionistorunaprogramlocatedontheserverinadirectorythat'stypicallycalledcgi-bin.”(IfyouwatchtheaddresswindowatthetopofyourbrowserwhenyoupushabuttononaWebpage,youcansometimesseecgi-bin”withinallthegobbledygookthere.)TheseprogramscanbewritteninmostIanguages.Perlisacommonchoicebecauseitisdesignedfortextmanipulationandisinterpreted,soitcanbeinstalledonanyserverregardlessofprocessororoperatingsystem.
ManypowerfulWebsitestodayarebuiltstrictlyonCGI,andyoucaninfactdonearlyanythingwithit.However,WebsitesbuiltonCGIprogramscanrapidlybecomeoverlycomplicatedtomaintain,andthereisalsotheproblemofresponsetime.TheresponseofaCGIprogramdependsonhowmuchdatamustbesent,aswellastheloadonboththeserverandtheInternet.(Ontopofthis,startingaCGIprogramtendstobeslow.)TheinitialdesignersoftheWebdidnotforeseehowrapidlythisbandwidthwouldbeexhaustedforthekindsofapplicationspeopledeveloped.Forexample,anysortofdynamicgraphingisnearlyimpossibletoperformwithconsistencybecauseaGIFfilemustbecreatedandmovedfromtheservertotheclientforeachversionofthegraph.Andyou'enodoubthaddirectexperieneewithsomethingassimpleasvalidatingthedataonaninputform.Youpressthesubmitbuttononapage;thedataisshippedbacktotheserver;theserverstartsaCGIprogramthatdiscoversanerror,formatsanHTMLpageinformingyouoftheerror,andthensendsthepagebacktoyou;youmustthenbackupapageandtryagain.Notonlyisthisslow,it'sinelegant.
Thesolutionisclient-sideprogramming.MostmachinesthatrunWebbrowsersarepowerfulenginescapableofdoingvastwork,andwiththeoriginalstaticHTMLapproachtheyaresittingthere,justidlywaitingfortheservertodishupthenextpage.Client-sideprogrammingmeansthattheWebbrowserisharnessedtodowhateverworkitcan,andtheresultfortheuserisamuchspeedierandmoreinteractiveexperieneeatyourWebsite.
Theproblemwithdiscussionsofclient-sideprogrammingisthattheyaren'tverydifferentfromdiscussionsofprogrammingingeneral.Theparametersarealmostthesame,buttheplatformisdifferent:
aWebbrowserislikealimitedoperatingsystem.Intheend,youmuststillprogram,andthisaccountsforthedizzyingarrayofproblemsandsolutionsproducedbyclient-sideprogramming.Therestofthissectionprovidesanoverviewoftheissuesandapproachesinclient-sideprogramming.
2.Plug-ins
Oneofthemostsignificantstepsforwardinclient-sideprogrammingisthedevelopmentoftheplug-in.Thisisawayforaprogrammertoaddnewfunctionalitytothebrowserbydownloadingapieceofcodethatplugsitselfintotheappropriatespotinthebrowser.Ittellsthebrowserfromnowonyoucanperformthisnewactivity.”(Youneedtodownloadtheplug-inonlyonce.)Somefastandpowerfulbehaviorisaddedtobrowsersviaplug-ins,butwritingaplug-inisnotatrivialtask,andisn'somethingyou'dwanttodoaspartoftheprocessofbuildingaparticularsite.Thevalueoftheplug-inforclient-sideprogrammingisthatitallowsanexpertprogrammertodevelopanewIanguageandaddthatIanguagetoabrowserwithoutthepermissionof
thebrowsermanufacturer.Thus,plug-insprovideabackdoor”thatallowsthecreationofnewclient-sideprogrammingIanguages(althoughnotallIanguagesareimplementedasplug-ins).
3.Scriptinglanguages
Plug-insresultedinanexplosionofscriptingIanguages.WithascriptingIanguageyouembedthesourcecodeforyourclient-sideprogramdirectlyintotheHTMLpage,andtheplug-inthatinterpretsthatIanguageisautomaticallyactivatedwhiletheHTMLpageisbeingdisplayed.ScriptingIanguagestendtobereasonablyeasytounderstandand,becausetheyaresimplytextthatispartofanHTMLpage,theyloadveryquicklyaspartofthesingleserverhitrequiredtoprocurethatpage.Thetrade-offisthatyourcodeisexposedforeveryonetosee(andsteal).Generally,however,youaren'tdoingamazinglysophisticatedthingswithscriptingIanguagessothisisnottoomuchofahardship.
ThispointsoutthatthescriptingIanguagesusedinsideWebbrowsersarereallyintendedtosolvespecifictypesofproblems,primarilythecreationofricherandmoreinteractivegraphicaluserinterfaces(GUIs).However,ascriptingIanguagemightsolve80percentoftheproblemsencounteredinclient-sideprogramming.Yourproblemsmightverywellfitcompletelywithinthat80percent,andsincescriptingIanguagescanalloweasierandfasterdevelopment,youshouldprobablyconsiderascriptingIanguagebeforelookingatamoreinvoIvedsolutionsuchasJavaorActiveXprogramming.
ThemostcommonlydiscussedbrowserscriptingIanguagesareJavaScript(whichhasnothingtodowithJava;it'namedthatwayjusttograbsomeofJava'smarketingmomentum),VBScript(whichlookslikeVisualBasic),andTcl/Tk,whichcomesfromthepopularcross-platformGUI-buildingIanguage.Thereareothersoutthere,andnodoubtmoreindevelopment.
JavaScriptisprobablythemostcommonlysupported.ItcomesbuiltintobothNetscapeNavigatorandtheMicrosoftInternetExplorer(IE).Inaddition,thereareprobablymoreJavaScriptbooksavailablethantherearefortheotherbrowserIanguages,andsometoolsautomaticallycreatepagesusingJavaScript.However,ifyou'realreadyfluentinVisualBasicorTcl/Tk,you'
bemoreproductiveusingthosescriptingIanguagesratherthanlearninganewone.(You'haveyourhandsfulldealingwiththeWebissuesalready.)
4.Java
IfascriptingIanguagecansolve80percentoftheclient-sideprogrammingproblems,whatabouttheother20percen—thereallyhardstuff?
”ThemostpopularsolutiontodayisJava.NotonlyisitapowerfulprogrammingIanguagebuilttobesecure,cross-platform,andinternational,butJavaisbeingcontinuallyextendedtoprovideIanguagefeaturesandlibrariesthatelegantlyhandleproblemsthataredifficultintraditionalprogrammingIanguages,suchasmultithreading,databaseaccess,networkprogramming,anddistributedcomputing.Javaallowsclient-sideprogrammingviatheapplet.
Anappletisamini-programthatwillrunonlyunderaWebbrowser.TheappletisdownloadedautomaticallyaspartofaWebpage(justas,forexample,agraphicisautomaticallydownloaded).Whentheappletisactivateditexecutesaprogram.Thisispartofitsbeauty—itprovidesyouwithawaytoautomaticallydistributetheclientsoftwarefromtheserveratthetimetheuserneedstheclientsoftware,andnosooner.Theusergetsthelatestversionoftheclientsoftwarewithoutfailandwithoutdifficultreinstallation.BecauseofthewayJavaisdesigned,theprogrammerneedstocreateonlyasingleprogram,andthatprogramautomaticallyworkswithallcomputersthathavebrowserswithbuilt-inJavainterpreters.(Thissafelyincludesthevastmajorityofmachines.)SinceJavaisafull-fledgedprogrammingIanguage,youcandoasmuchworkaspossibleontheclientbeforeandaftermakingrequestsoftheserver.Forexample,youwon'needtosendarequestformacrosstheInternettodiscoverthatyovegottenadateorsomeotherparameterwrong,andyourclientcomputercanquicklydotheworkofplottingdatainsteadofwaitingfortheservertomakeaplotandshipagraphicimagebacktoyou.Notonlydoyougettheimmediatewinofspeedandresponsiveness,butthegeneralnetworktrafficandloadonserverscanbereduced,preventingtheentireInternetfromslowingdown.
OneadvantageaJavaapplethasoverascriptedprogramisthatit'incompiledform,sothesourcecodeisn'availabletotheclient.Ontheother
hand,aJavaappletcanbedecompiledwithouttoomuchtrouble,buthidingyourcodeisoftennotanimportantissue.Twootherfactorscanbeimportant.Asyouwillseelaterinthisbook,acompiledJavaappletcancomprisemanymodulesandtakemultipleserverhits”(accesses)todownload.(InJava1.1andhigherthisisminimizedbyJavaarchives,calledJARfiles,thatallowalltherequiredmodulestobepackagedtogetherandcompressedforasingledownload.)AscriptedprogramwilljustbeintegratedintotheWebpageaspartofitstext(andwillgenerallybesmallerandreduceserverhits).Thiscouldbeimportanttoth