introductiontoinformationsystems2.12

上传人:pu****.1 文档编号:579740276 上传时间:2024-08-27 格式:PPT 页数:44 大小:389KB
返回 下载 相关 举报
introductiontoinformationsystems2.12_第1页
第1页 / 共44页
introductiontoinformationsystems2.12_第2页
第2页 / 共44页
introductiontoinformationsystems2.12_第3页
第3页 / 共44页
introductiontoinformationsystems2.12_第4页
第4页 / 共44页
introductiontoinformationsystems2.12_第5页
第5页 / 共44页
点击查看更多>>
资源描述

《introductiontoinformationsystems2.12》由会员分享,可在线阅读,更多相关《introductiontoinformationsystems2.12(44页珍藏版)》请在金锄头文库上搜索。

1、SSD1: Introduction to Information SystemsUnit 2: Introduction to Java and Object-Oriented Programming ISS, Wuhan University硅屯庇颤科定黑鸟盔砧惺娩宪栖网帜毙蓉螟邓甩极曙抬写杯符茧海饲浊顾introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-22.1 Programming with JavaProgrammingwithObjectsJavaProgramDevelopmentFi

2、rstLookatJavaElement of a Java ServletPlanningServletDevelopmentGuidelinesforJavaDevelopment陵茬傍咎型崇蹬阐晕性语阀讽继逛赂佯鼠宵掺炎间又属咒南柔瀑屈瞥撒辅introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-22.1.4 Elements of a Java ServletTheWelcomeServletMoreServletsGettingUserInputDebuggingaServlet邦约瘫辐励叹耐粉

3、渡靡更僧户混莉瑚痉胎陕峨胖翅指倡嚣北泪遥逢败用恼introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2注释注释(comment)/* */孰蘸萎朱衡宗愈钉装拔雪绵酷因接员惨北活据值藻檀蹈赛抒剑讨己缨猾落introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Importpublic class extends void throws Keywords享悄轧童心嫩惰庄瀑鼓哟眩刑遥栈抉纬蒸如桔瓜欲莫坑诲尼药炎滓铺淬

4、褂introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2 Welcome Welcome HttpServlet HttpServlet doPost doPost HttpServletRequest HttpServletRequest HttpServletResponse HttpServletResponse PrintWriter PrintWriter ServletException ServletException IOException IOException request re

5、quest response response out out setContentType setContentType getWriter getWriter printlnprintln Identifiers鞭尹楔彭卉的捡你部统线纵久驭夫挠毫振谷檀丰蓝痔含彬侩祝蚊时人锻汕introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Import all the clssses contained in java.io, which are required by the servlet to do a

6、ny input or output task蒂袋赞螺纫癌鸿条措熬裸品侵乏泻便炳绰炯钙黎匪斑歹裸脚驴秩彬玖缕牙introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2The description for the Welcome class.the servlet receives a doPost message and response it. 眉惫拭彭勤糟莫给录泉暂逛贬嘉择铡振皱锐供队叙婪曾适盈箱里笨更钵渝introductiontoinformationsystems2.1-2introduct

7、iontoinformationsystems2.1-2使用使用setContentType设定设定servlet生成的文件的格式:生成的文件的格式: “text/plain”表示生成一表示生成一个个 纯文本文件;纯文本文件; “text/html” 表示生成一表示生成一个个 HTML Web网页;网页;“ text/gif”表示生成一个表示生成一个 GIF文件文件. Sending setContentType message to response object (invoking method) 述线滴假惭张哑混夏型蛛复镰思珊豹骚费路媳祷春息宗鼻粪谷误讨浮孝株introductionto

8、informationsystems2.1-2introductiontoinformationsystems2.1-2send the getWriter message to the response object 蔑完鸽皆寝洁所郎丹憾陈业唤絮瓣精伎销捍练齿池畅疯惦议湾谁紫明浊烹introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2println message requires one resource actual text to execute, 欢久锻恩趣端汉荡触味载举赊宙脱狠醇拣皖冗生朵

9、品毅亢续式俞诣拖娜珐introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2WritingservletsthatsendaWebpagetothebrowser.Writingservletsthatsendanimageinsteadofdisplayingawelcomemessage.Example: HtmlWelcome servletuu参见在线教材参见在线教材参见在线教材参见在线教材2.1.42.1.4节的节的节的节的Listing 2Listing 2More Servlets涡近旨录

10、俩塞赁芭虾咎炭组磊坐倡洞唯乍贼桐行米索捍屠谭插渴乓坡枷房introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2WhiletheforminMyWelcomeForm.html allowedtheusertoenteraname,themessagesentbytheWelcome servlethadnothingtodowiththenameenteredbytheuser.ThisisbecausethesourcecodefortheWelcome servletweexamineddidno

11、tattempttofindoutwhattheuserenteredandtoincludethatinformationintheWebpagesenttothebrowser.Getting User Input掌噶帖闽藕食哑聪疥圭厉担讼排寄辖及山迢拈译穗膊拳括耙故浴翰蚀联前introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2SavetheMyWelcomeForm.javaasPersonalWelcome.javaandmodifyittogetusersinputparameter.St

12、ringuserName=request.getParameter(Name);Compilethesourcefileandmodifytheformcorrespond.Reloadtheclassfileandhtmlfiletodebug.Getting User Input寐舆雾仙煌盂孤招悠址靖豺很惭杭借酚间践矩恢洪偶硝汞迹戳戏虎垃魏俘introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2send the getParameter message to request object诞泪捕跟澳

13、蛛缀禁爷华准绅挺粱鸥癣亢汕营癣彰扮俊哈怂黑专绊闹政削篱introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Adding System.out.println statements in servlet source codeuuSystem.out.printlnSystem.out.println(“Debugging information); (“Debugging information); 参见参见参见参见2.1.42.1.4节节节节listing 4listing 4的的的的Welcom

14、.javaWelcom.javaInformationabouthowfartheservletexecutionhasprogressedisdisplayedintheconsolewindowoftheworkbench.uu在在在在servletservlet运行时,可以在运行时,可以在运行时,可以在运行时,可以在workbenchworkbench的窗口中的窗口中的窗口中的窗口中看到调试提示信息。看到调试提示信息。看到调试提示信息。看到调试提示信息。Debugging a Servlet(调试)(调试)砒垮慎宠脊囤剪骆猩迁状本侯越恶福侄诽刃鹃狙煎掌内闯睹祭峡渊妙伴人introduct

15、iontoinformationsystems2.1-2introductiontoinformationsystems2.1-2 SystemSystem类是一些与系统相关属性和方法的集合类是一些与系统相关属性和方法的集合类是一些与系统相关属性和方法的集合类是一些与系统相关属性和方法的集合 SystemSystem类是一个特殊类,它是一个公共最终类,不能被类是一个特殊类,它是一个公共最终类,不能被类是一个特殊类,它是一个公共最终类,不能被类是一个特殊类,它是一个公共最终类,不能被继承,也继承,也继承,也继承,也不能被实例化不能被实例化不能被实例化不能被实例化,即不能创建,即不能创建,即不能创

16、建,即不能创建SystemSystem类的对象。类的对象。类的对象。类的对象。 System.out is an instance of System.out is an instance of PrintStreamPrintStream class. class.爆狮她稻愁烫越狂蓟氟笋腾硫埔币钨择遂褪窄柴幌煽蕾僳逆禽纬坤深邻徽introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Servlet运行时,调试提示信运行时,调试提示信息显示在息显示在workbench的信息提的信息提示窗口示窗口搏僻茸大

17、茎宇拼转满亚阿肮诚裤歇趟卿酪侠转妮坑矽却惨就向痞郴赚菲哺introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-22.1 Programming with JavaProgrammingwithObjectsJavaProgramDevelopmentFirstLookatJavaElementofaJavaServletPlanning Servlet DevelopmentGuidelinesforJavaDevelopment绞桂咸浆咒月商漠也驶味输睹廖掘垣片肪涕蕾范摩殖儡橡孩坞默弦巳别为intro

18、ductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-22.1.5 Planning Servlet DevelopmentThinkingAheadDefiningtheProblemPlanningtheSolutionCodingtheServletTestingandEvaluating须涎撼联桅逞藤吸针萄弱娟权挪楚评氯喊栗咀蜡光她辣毋路蹈闽痢映矢拌introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Think

19、ing aheadJ2SE SDK installation uuJ2SEJ2SEuu环境变量环境变量环境变量环境变量pathpath和和和和classpathclasspath是否设置正确是否设置正确是否设置正确是否设置正确 iCarnegie Servlet Workbench installationuuWorkbenchWorkbench安装目录下安装目录下安装目录下安装目录下liblib目录下的目录下的目录下的目录下的javax.servlet.jarjavax.servlet.jar是否添加到是否添加到是否添加到是否添加到classpathclasspath中中中中描布矩匹镰此蔬耻

20、事滥趴复樟颓鞍辕滴根垣斜渡晓丹宏怨沤衍拱起尽爷焙introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Defining the Problem 定义网页中所需控件的类型、数目以及名字定义网页中所需控件的类型、数目以及名字定义网页中所需控件的类型、数目以及名字定义网页中所需控件的类型、数目以及名字(name)(name) 定义定义定义定义servletservlet的名称,如何在网页中被调用的名称,如何在网页中被调用的名称,如何在网页中被调用的名称,如何在网页中被调用 定义定义定义定义servletse

21、rvlet处理信息得到的结果处理信息得到的结果处理信息得到的结果处理信息得到的结果 download download TravelRequest.zipTravelRequest.zip to the directory to the directory where you plan to workwhere you plan to work uuTravelRequest.javaTravelRequest.java isaisaskeletonskeletonJavasourcefile(Javasourcefile(.java.java) )fortheTravelRequestser

22、vlet.fortheTravelRequestservlet.uuSeeListing1TravelRequestTemplateFile,completeit.SeeListing1TravelRequestTemplateFile,completeit.国急颅淘鸥躬糯蝉锄苗少佳工咖晤肌恳纬通缄劈呜喇陕咸增始邵呻涨洼箱introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2斩獭榴盯赦愤彦椽坤患云僵盈迄钓宾伐时鳞曾货稽滁硝曙般拘杏榆春环忆introductiontoinformationsystems

23、2.1-2introductiontoinformationsystems2.1-2始藐厨赎戳阿绰遵距壕岳凄公浑霓师闭检摸墟兜恰碾酪傻再终锌晚披审惶introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Planning the Solution Indicate the content type being returned by the response Indicate the content type being returned by the response (定义响应返回的页面的内容类型)

24、(定义响应返回的页面的内容类型)(定义响应返回的页面的内容类型)(定义响应返回的页面的内容类型) Retrieve an output stream to send data to the client Retrieve an output stream to send data to the client (获取(获取(获取(获取一个输出流,使用这个输出流将数据传送给客户一个输出流,使用这个输出流将数据传送给客户一个输出流,使用这个输出流将数据传送给客户一个输出流,使用这个输出流将数据传送给客户 ) Get user input from the form: name and destina

25、tion Get user input from the form: name and destination (获(获(获(获取用户在表单中的输入取用户在表单中的输入取用户在表单中的输入取用户在表单中的输入 ) Start by building the Web page headerStart by building the Web page header(建立网页的(建立网页的(建立网页的(建立网页的headerheader) Add the image Add the image (加入图片(加入图片(加入图片(加入图片 ) Add the confirmation message,

26、with the name Add the confirmation message, with the name (加入文本(加入文本(加入文本(加入文本信息,并将从请求那里得到的姓名放入到信息中信息,并将从请求那里得到的姓名放入到信息中信息,并将从请求那里得到的姓名放入到信息中信息,并将从请求那里得到的姓名放入到信息中 ) End by building the Web page footer End by building the Web page footer (结束网页(结束网页(结束网页(结束网页 )塌滓辈滥乙多陀端髓都庭程威册吗郴宅颊序锰弦褪喇浅嫂呼听梯乙笑村寓introduct

27、iontoinformationsystems2.1-2introductiontoinformationsystems2.1-2硫挖观深烩玫驾操莉泵谴汽肋嘶鄙涧蠕坝傈症潦龋眯降碌筛苏炼奸刚彰橡introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Questions 1? Theservletneedstogetonlytwoofthethreeuserinputsfromtheform:thenameandthedestination.Howtoobtaintheseinputsinourservl

28、et.uuSendtheSendthegetParametermessagetothegetParametermessagetotheHttpServletRequestobjectHttpServletRequestobjecttogetthevalueofthetogetthevalueofthetextinputcontroltextinputcontrolNameName. .uuSendtheSendthegetParametermessagetothegetParametermessagetotheHttpServletRequestobjectHttpServletRequest

29、objecttoobtainthevalueoftoobtainthevalueoftheradiobuttoninputcontroltheradiobuttoninputcontrolDestination Destination fromthefromtheformthatactuallyprovidesthenameoftheimageformthatactuallyprovidesthenameoftheimagefileforthedestinationcityselected.fileforthedestinationcityselected.旧蓉梢肥樱原怯迈酵蓄烯喀洪管吻敞书师

30、隅区贝具删申冀顾批补舱捡颊宋introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Questions 2?HowtheservletwouldgeneratetheWebpagebasedontheuserinputsobtainedfromtheform. TobuildaWebpage,theservletmustoutputallTobuildaWebpage,theservletmustoutputalltheHTMLcodefortheWebpage.theHTMLcodefortheWeb

31、page. HTMLcodeneedsanIMGtagHTMLcodeneedsanIMGtag TheHTMLcodemustincludealineoftextTheHTMLcodemustincludealineoftext out.printlnout.println statementshouldbeused.statementshouldbeused. stringconcatenationstringconcatenation诊骂仪白郁兄弯利邓剿遁配糖傲铃赏朋晚翌贼晦戚迪爬德恬傅技绘此窟动introductiontoinformationsystems2.1-2introduct

32、iontoinformationsystems2.1-2Steps WritethecodetobuildtheWebpagewithaheader,afooter,andaconfirmationmessagebuiltwithsomedummyname.WritethecodetoobtaintheuserschoiceofdestinationcityandtoconstructaWebpagewiththeimageforthedestinationcity.Writethecodetoobtaintheusersnameandsubstitutethatforthedummyname

33、intheconfirmationmessage.豪瘪字淳攀堆蝉频亦抚伴咕剖墨掏密们宽玲居呵疥搽概饿卿漏断冲挥楚圈introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Foreachstep,weshoulduuEdittheservletsourcefileEdittheservletsourcefileTravelRequest.java TravelRequest.java totoincludethecodeforthatstep.includethecodeforthatstep.uuCom

34、piletheservletsourcefileusingtheCompiletheservletsourcefileusingthejavac javac commandcommanduuRuntheservletusingtheforminRuntheservletusingtheforminTravelRequestForm.html TravelRequestForm.html andtheiCarnegieServletandtheiCarnegieServletWorkbenchtoseeresult.Workbenchtoseeresult.找稗蔫尾歼胸撂鸿腑针娱肚呼啼宽鹿泻延险

35、仪蹬快赫臂靡践表侗沮扣饱闲introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Coding a Servlet ExampleExampleuuStep1: Step1: outputtheconfirmationmessageincludingthedummynameoutputtheconfirmationmessageincludingthedummynameVisitorVisitor CompileandRunCompileandRunuuStep2: Step2: ThegetParam

36、eterstatementforobtainingthevalueoftheradiobuttonThegetParameterstatementforobtainingthevalueoftheradiobuttoninputcontrolcalledinputcontrolcalledDestinationDestination Theout.printlnTheout.println statementsthatoutputHTMLcodefromtheservlet.statementsthatoutputHTMLcodefromtheservlet.includingtheHTMLc

37、odefortheincludingtheHTMLcodefortheIMGIMGtagwhosetagwhosesrcsrcandandaltalt attributesbothspecifytheimagefileobtainedearlier.attributesbothspecifytheimagefileobtainedearlier. CompileandRunCompileandRunuuStep3:Step3: AddthegetParameterstatementforobtainingthevalueofthetextAddthegetParameterstatementf

38、orobtainingthevalueofthetextinputcontrolcalledinputcontrolcalledNameName Edittheout.printlnEdittheout.println statementthatoutputsthegreetinginthestatementthatoutputsthegreetingintheconfirmationmessagetoincludethevalueobtainedaboveinsteadofconfirmationmessagetoincludethevalueobtainedaboveinsteadofth

39、edummynamethedummynameVisitorVisitor. . CompileandRunCompileandRun氛喜射总河氏久点血跪靡庚侈栋斗京若茹悟卒呸市多玄箩哮绪班届除蓬模introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Testing and Evaluating the Servlet WedoneedtocheckthattheresponsegeneratedbyWedoneedtocheckthattheresponsegeneratedbyourservleti

40、sindeedasspecifiedtous.ourservletisindeedasspecifiedtous. WealsoneedtomakesurethattheWebpageWealsoneedtomakesurethattheWebpageconstructedbytheservletisvalidHTML.(WDG)constructedbytheservletisvalidHTML.(WDG) RemembertofollowthestepsRemembertofollowthestepsuuDefinetheproblemyouareattemptingtosolve.Def

41、inetheproblemyouareattemptingtosolve.uuMakeaplanonhowyoucandothis.Makeaplanonhowyoucandothis.uuCodethesolutionasperyourplanabove.Codethesolutionasperyourplanabove.uuEvaluateyoursolutionagainstthespecificationgiventoEvaluateyoursolutionagainstthespecificationgiventoyou.you.吨游问正赐金雁讶冶掏律亨峪钧稀镐掇阶峡耿坞辛前演诌的矗

42、奇嫉阮滁脯introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-22.1 Programming with JavaProgrammingwithObjectsJavaProgramDevelopmentFirstLookatJavaElementofaJavaServletPlanningServletDevelopmentGuidelines for Java Development黑顺扛梢蔗踢洒充翠矮绎痊池徽糖贞氢滁论轰百寥剪茨掉兔蜘喝爸搓蜘幸introductiontoinformationsy

43、stems2.1-2introductiontoinformationsystems2.1-22.1.6 Guidelines for Java DevelopmentTheprocessofProgrammingTheJavaAPIDocumentationCodingStyleCommentingSourceCodeJavadoc硒厨勋雇粱彻勘谐脉里酥邢拎瞩奈网削拭谐牛筛葬坐帮析鸡墅驯醋冒盗蛀introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Developing Web pages Defin

44、ingWebpagecontentDefiningWebpagecontentuu定义网页内容定义网页内容定义网页内容定义网页内容 PlanningthelookofthepageandtheneededlinksPlanningthelookofthepageandtheneededlinksuu规划网页的布局和所需的链接规划网页的布局和所需的链接规划网页的布局和所需的链接规划网页的布局和所需的链接 ImplementingtheWebpagebywritingitImplementingtheWebpagebywritingitincrementallyinsmallstepsincrem

45、entallyinsmallstepsuu一步步实现网页内容一步步实现网页内容一步步实现网页内容一步步实现网页内容 EvaluatingtheWebpageintwowaysEvaluatingtheWebpageintwowaysuu评估网页评估网页评估网页评估网页 使用浏览器看网页的效果以测试使用浏览器看网页的效果以测试使用浏览器看网页的效果以测试使用浏览器看网页的效果以测试HTMLHTML是否正确是否正确是否正确是否正确 是否满足规范是否满足规范是否满足规范是否满足规范虐挛氖亢九飞虱乃尸第夺猴诚悍棠蛹机殿挠浇磨毯纹琵玻蘑噶旭榆愧矾讫introductiontoinformationsys

46、tems2.1-2introductiontoinformationsystems2.1-2The process of Programming (编程过程编程过程) DefinitionPhaseDefinitionPhaseuuDefineand/orredefinetheproblemDefineand/orredefinetheproblem 定义和定义和定义和定义和/ /或重定义问题或重定义问题或重定义问题或重定义问题 PlanningPhasePlanningPhaseuuPlanasolutiontotheproblemPlanasolutiontotheproblem 计划实现

47、问题的解决方案计划实现问题的解决方案计划实现问题的解决方案计划实现问题的解决方案 CodingPhaseCodingPhaseuuCodethesolutionCodethesolution 编码实现解决方案编码实现解决方案编码实现解决方案编码实现解决方案 EvaluationPhaseEvaluationPhaseuuEvaluateandtesteverythingEvaluateandtesteverything 评估和测试评估和测试评估和测试评估和测试啮碘纵斋巷超座侧趾夺因锄痘蒸悼茨娩务猴啄称该亨阴棋宾罪窜殉陪庭滞introductiontoinformationsystems2.1-

48、2introductiontoinformationsystems2.1-2 define/redefine codeplanevaluate/test啼珊勾拉昏峭摄送溃既捍抠黔哀换丧伶视壁事槛鹊惠撰魔讳陶秆饯湿妨癣introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Notes on Process ProcessbecomessignificantasthecomplexityofProcessbecomessignificantasthecomplexityofprogramsincreases

49、.programsincreases. Most of the time spent in evaluation and testingMost of the time spent in evaluation and testing EvaluateyourrestatementtoensurecorrectproblemEvaluateyourrestatementtoensurecorrectproblembeingsolvedbeingsolved UseUsedivide-and-conquerdivide-and-conquertosolveabigproblemtosolveabi

50、gproblem Codethesmallpiece,inspect,andvalidatebeforeCodethesmallpiece,inspect,andvalidatebeforemovingtonextpiece.movingtonextpiece. More time spent on process implies less time spent More time spent on process implies less time spent programming.programming.Programming is not coding. Coding is not p

51、rogramming. 从宾帛领钧绰前贱吊频左津女羹兆符弛寸权猜上捐吗瞻弯只羡辈副诀帐议introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2Java API DocumentationOneormoreofAPIsneedtobeusedforJavaAPIprovidesasetofclassesandmethodstoaprogrammer,thusprovidingare-usablefoundationtobuildupon.JavahasitsownJavaAPIDocumentation

52、sitethatisusefulforfindingaccurateinformationfast.Forexample,classesandmethodsusedintheWelcomeservletcanbelookedupattheJavaServletSpecificationsite.袭稽舱涧汛窍浦棱袱旱弱短趋湃坍莱蓉纸汽窗爵磷痹奢梧迢遁遏诸凯摈踞introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2吓饮谦捣元益仑沥霍胜列秉俩芥讫凳喷陷诉厕仆拽先聊柯旬嚎杭爵判文戍introductionto

53、informationsystems2.1-2introductiontoinformationsystems2.1-2Coding Style CodeshouldbewrittensoastobereadableCodeshouldbewrittensoastobereadableuuBytheauthoratalatertimeBytheauthoratalatertimeuuOthersexpectedtoworkonitforextendingfunctionalityorOthersexpectedtoworkonitforextendingfunctionalityordebug

54、gingdebugging Codeshouldbeefficient,tofunctionasexpectedinCodeshouldbeefficient,tofunctionasexpectedinthemostoptimalwayintermsoftimeandusageofthemostoptimalwayintermsoftimeandusageofsystemresources.systemresources.uuThiscomeswithexperienceandthoroughknowledgeofThiscomeswithexperienceandthoroughknowl

55、edgeofthelanguage.thelanguage. JavaCodingConventionsJavaCodingConventionsdocumentpresentsandocumentpresentsanexhaustivesetofrulesandguidelinesforwritingJavaexhaustivesetofrulesandguidelinesforwritingJavaCode.Code.智搞嘘拒选名您罚竖降谍反梦魂翟影肖磁稿期按几鸦纹绦翼笔宵哈缚弥幕introductiontoinformationsystems2.1-2introductiontoinfo

56、rmationsystems2.1-2Commenting Source Code CommentsanessentialelementofdocumentingcodeCommentsanessentialelementofdocumentingcode Well-commentedcodeismoremaintainableforotherWell-commentedcodeismoremaintainableforotherdevelopers,andreducesSoftwarescostofownershipdevelopers,andreducesSoftwarescostofow

57、nership Well-writtencommentsshouldexplainthepurposeofWell-writtencommentsshouldexplainthepurposeoftheclassnearthebeginningoftheclasstheclassnearthebeginningoftheclass EachmethodshouldhaveatleastonecommentEachmethodshouldhaveatleastonecommentimmediatelybeforethemethodnametoexplainitsimmediatelybefore

58、themethodnametoexplainitspurposepurpose ImportanttoexpressintentbehindcodethanjustImportanttoexpressintentbehindcodethanjustrestating.restating.稻段央绪垮根束镜挑槽帅得弓兜鸥瓷踏狄导器跳两柜技绳荣捏铅冯逛勺凯introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2JavadocThe Java SDK offers a tool for documenting

59、code called Javadoc. If you type your comments in a specified format, you can run the Javadoc program on your class and an HTML document will automatically be generated that contains your comments in Javas standard documentation format.入管酗成蒋砧娠蹬羊怯梢疹璃嚼诧滑沤耸冗秒员毫诊亮署予醉茅胰锋苗拘introductiontoinformationsystems

60、2.1-2introductiontoinformationsystems2.1-2Summary2.1Programming with Java2.1Programming with JavaProgrammingwithObjectsJavaProgramDevelopmentFirstLookatJavaElementofaJavaServletPlanningServletDevelopmentGuidelinesforJavaDevelopment翼咐碘习倦商鹤于伞舜忠滇匈瞥描及需卯泉耕蹭砍梗鸦胖澄舶帕艘挠醋僳introductiontoinformationsystems2.1-2introductiontoinformationsystems2.1-2

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号