订单管理系统中英文对照外文翻译文献.docx
《订单管理系统中英文对照外文翻译文献.docx》由会员分享,可在线阅读,更多相关《订单管理系统中英文对照外文翻译文献.docx(12页珍藏版)》请在冰点文库上搜索。
![订单管理系统中英文对照外文翻译文献.docx](https://file1.bingdoc.com/fileroot1/2023-5/5/adf7fc77-5a80-4c91-a45f-57e3b8959b8c/adf7fc77-5a80-4c91-a45f-57e3b8959b8c1.gif)
订单管理系统中英文对照外文翻译文献
中英文对照外文翻译
(文档含英文原文和中文翻译)
MySQLandJSPWebapplications
JSPdevelopersencounteruniqueproblemswhenbuildingwebapplicationsthatrequireintensedatabaseconnectivity.MySQLandJSPWebApplicationsaddressesthechallengesofbuildingdata-drivenapplicationsbasedontheJavaServerPagesdevelopmentmodel.MySQLandJSPWebApplicationsbeginswithanoverviewofthecoretechnologiesrequiredforJSPdatabasedevelopment--JavaServerPages,JDBC,andthedatabaseschema.ThebookthenoutlinesandpresentsanInternetcommerceapplicationthatdemonstratesconceptssuchasreceivingandprocessinguserinput,designingandimplementingbusinessrules,andbalancingtheuserloadontheserver.ThroughtheJDBC(JavaDataBaseConnector),thedevelopercancommunicatewithmostcommercialdatabases,suchasOracle.ThesolutionspresentedinMySQLandJSPWebApplicationscenterontheopensourcetoolsMySQLandTomcat,allowingthereaderanaffordablewaytotestapplicationsandexperimentwiththebook'sexamples.
SoWhatIsJSPAllAbout?
Ifyoumeettherequirementsmentioned,youshouldalreadyhaveaprettygoodideawhattheanswertothisquestionis.JSPisallaboutdoinghighlyobject-orientedWebsitesthatcanleverageallthebestpracticesofmodernsoftwareengineering.ThesepracticesincludethingssuchasSQLdatabasesandUML-baseddesign.Thisisn'ttosaythatJSPisacure-allandthatusingitwillautomaticallymakeyourWebsiteaparagonofengineeringart.It'sjustaspossibletodesignbadWebsitesinJSPaswithanyothertechnology.That'swhy,asyougothroughthetext,youwillseehowtoincorporatethebestpracticesandhowtoavoidthepitfallsofconveniencewhenprojectsgetstressful.JSPitselfisanevolutionarystepalongthepaththatstartedwiththefirststaticWebservers,movedthroughCGI-enabledservers,andfinallythefirstgenerationofscript-enabledservers.JSPislessaWebserverwithaJavacomponentthanitisaJavaenginethatunderstandstheWeb.
JSPgrewoutofJavaservlets.ServletsallowthedevelopertohandletheincomingWebrequestsusingaJavaprogramthathasaccesstoallthenormalinformationthataCommonGatewayInterface(CGI)programwould.Inaddition,theservlethasaccesstosession-persistentobjects.TheseareJavaobjectsthatareassociatedwithaspecificusersessionandcanbeusedtostorestatebetweenrequests.Servletprogrammingwasamajorstepforwardinallowingdeveloperstowritewell-structuredmodularWebapplicationsusinganobject-orientedlanguage.Italsosolvedtheproblemofstatepersistence,allowingmoreinformationtoresideontheserverduringatransactionandlesstohavetopassbackandforthbetweentheuserandtheserver.Servletsstillsufferedfromonemajorproblem.BecausetheyeventuallyneedtospitoutHTML,theHTMLcodinghadtobeembeddedintheservletcode.Thisledtocodefragmentsliketheoneshownhere:
Out.println("\n
\n
ThankyouforRegistering
\n");
Out.println("");
Thiskindofembeddinggetsveryoldveryfastwhenyouhavetocodealotofpages.Inaddition,havingtoescapeallofthequotationmarkscanleadtoalotofconfusingandhard-to-finderrorsifyouleaveoutabackslash.Eventually,astill-betterideaemerged.SupposethatyoucouldcombinethebestofstaticHTMLpagesandwiththeinteractivecapabilitiesofservlets.TheresultwasJavaServerPages(ontheMicrosoftside,theresultwasActiveServerPages).AsFigureI.1shows,JSPisacomplicatedbeast.Inthenextchapter,you'llwalkthroughthisflowindetail,butforthemoment,herearethemajorsteps:
1.ArequestcomesinfromabrowserusingthenormalHTTPrequestformat.
2.TheWebserverhandsofftherequesttoJSP.JSPlooksatthefilenameandfindstheappropriateJSPfile.
3.The.jspfileisconvertedintoa.javafile,containingJavacodethatwillcreateaclasswhosenameisderivedfromthe.jspfilename.
4.JSPthencompilesthe.javafileusingjavactoproducea.classfile.Notethatthetwopreviousstepsareskippedifa.classfilealreadyexistsandisnewerthanthe.jspfile.
5.Aninstanceofthenewlycreatedclassisinstantiatedandsentthe_jspServicemessage.
6.Thenewinstancelookstoseeifthereisalreadyaninstanceofthestuff.Userobjectcalleduserexistinginthesessionobjectspaceforthecurrentlyconnecteduser.Ifnot,oneisinstantiated.
7.Aspartofservicingstuff.jsp,theuserinstanceiscalledwiththegetUserName()method.
8.IftheJSPprocessingrequiresaccesstoinformationinadatabase,itusesJDBCtomaketheconnectionandhandletheSQLrequests.
Asyoucansee,atremendousamountofpowerisavailableintheJSPworld.DevelopersarefreetowriteWebpagesthatlookmostlylikeHTML,exceptwherecalloutstoJavaarerequired.But,atthesametime,theyarefreetodevelopfullyfleshed-outobject-orientedapplicationsusingallthefeaturesthatJavacanbringtobear.Theyalsogetallthebenefitsofservlets,includingsessionpersistence.
WhyDoWeNeedDatabases?
Well,onereasonissothatLarryEllisonofOraclecanaffordtokeephimselfonProzacwhenhethinksaboutBillGates.Amoreseriousansweristhesamereasonthatdrovemantofirstpressastickagainstapieceofwetmud:
becauseit'sgoodtowritethingsdown.Webserversaremarvelouscreatures,butthey'reabitlikeidiotsavants.AskthemtoserveaWebpageorrunapieceofJava,andtheyperformlikeachamp.Butstartaskingthemtorememberwhattheydidfiveminutesago,andtheydevelopamnesiafasterthanacharacterinasoapopera.
Thefirstandmostimportantreasonthatyouusedatabasesisthatthere'salotinane-commercetransactionthatyouneedtorememberandtrack:
•Auser'sname,address,creditcard,andotherinformationpreviouslyenteredonaregistrationpage
•hattheusermighthaveputintoashoppingcartandleftfromaprevioustransaction
•Whatitemsareinstock,alongwiththeirprice,description,andsoon
•Ordersthatneedtobefulfilled,ordersthathavebeenshipped,anditemsthathavebeenbackordered.
Now,youcouldstoreallthisinformationinaflatfileontheserver'sharddisk,butthereareotherimportantpropertiesthatyouwanttohaveforthisdata:
•Youwanttobeabletobackoutatransactionifpartofitfails.
•YouwanttobeabletolocatethedatasomewheremoresecurethantheWebserver,whichcouldbeinaDMZoroutsidethefirewallaltogether.
•Youwanttobeabletoaccessdatasuchasuserdataorproductsquickly,eveniftherearethousandsormillionsofthem.
Whenyouaddtheseitemstotheshoppinglist,onlyarelationaldatabasewillreallydothejobeffectively.
MySQL
Manysitesdon'tneedthebattleshipstrength(andpricetag)ofOracle.MySQLisanopen-sourceSQLdatabaseavailableforanyonetouse,withmany(althoughnotall)ofthefeaturesofitsbigbrothers,suchasOracle.
MySQLisavailableforjustaboutanycomputerthathasdecentpower—itisfairlylightweightontheprocessorandeasytoinstall(10minutes,asopposedtomultiplehoursforOracle).
So,perhapsyouarewondering,what'sthecatch?
WhatareyounotgettinginMySQLthatmakespeopleturntoOracle?
Well,MySQLisaneatlittlepackage,butitismissingsomethingsthatwouldbenicetohaveinaperfectworld.
AmajorfeaturethatMySQLdoesnotofferisdatabaseconsistencychecking.Youcanuseforeignkeytagsinyourschema,butMySQLcheerfullyignoresthem.AlotofDBAsIknowwouldconsiderthisaverybadthing.
Aforeignkeyconstraintpreventsyoufromcreatinginconsistentdata.Forexample,let'ssupposethatyouhadaschemethatlookedlikethis:
CREATETABLEUSER(
USERIDINTEGER,
FIRST_NAMEVARCHAR(80),
LAST_NAMEVARCHAR(80));
CREATETABLEPURCHASE(
USERIDFOREIGNKEYUSER(USERID),
ITEMINTEGER,
QUANTITYINTEGER);
InadatabasesuchasOracle's,ifyoucreatedanentryinthePURCHASEtablewithauserIDof3,therewouldhavetoalreadybeauserIDof3intheUSERtableoranerrorwouldoccur.Similarly,youcouldn'tdeleteuser3fromUSERifitwasreferencedinPURCHASE.TheMySQLfolksmakeaprettyimpassionedargumentintheirdocumentationthatdependingonforeignkeysfordataintegrityisabadideaanyway,butconvincingyourDBAofthisphilosophyislikelytodegradeintoareligiousdebate.
Inaddition,someotherfeaturesaremissing,suchassubselectsandselectinto.Butprobablytheothermajorpiecethatyouwillmissistherollback/commitfunctionality.MySQLdoesimplementrollbackandcommitforcertaintypesoftables,butnotallofthem.Again,theMySQLfolksoffertheirownspinonwhythisisokay,butbeingabletorollbacktransactionsis(inmyopinion)importantenoughtomakesurethatyouhaveitavailable.
Rollbackallowsyoutosetasavepointonthedatabasebeforestartingtodoaseriesoftransactionswithit,andbeabletoeitherrollbacktotheoriginalstateorcommitthechangesattheend.Forexample,whenrecordingapurchase,youneedtorecordadebitagainsttheuser'saccountandenterarecordintotheshippingtablesothatyou'llknowlatertoshiptheitem.Let'ssaythatthesecondpartfails.Youwouldn'twanttochargetheuserbutnotshiptheitem.Thus,you'dwanttorollbacktothestatebeforethetransactionbegan.
So,MySQLisn'tafull-blownproductiondatabase—atleast,notyet.It'sstillgoodenoughforprobably90%ofthee-commercesitesintheworld,however.Andversion4.0,whichisinalphaasofthiswriting,addressesanumberoftheseconcerns,including