仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 562|回复: 9
打印 上一主题 下一主题

[学习教程] ASP.NET教程之怎样在vs.net中使用UML来建模(转自MSDN...

[复制链接]
山那边是海 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 22:50:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
今天去面试,被问到C#中的new关键字,看了那么多的书对new关键字还是有一定认识,回来又把new复习了一遍,发现了许多以前还不知道的细节。VisuallyModelSoftwareApplications
Note:SomefeaturesmaynotbeofferedinthepubliclyavailableVisualStudio.NETBeta2.
Customersbuildingcomplexdistributedapplicationsfacethechallengeofsuccessfullycommunicatingapplicationarchitectureandrequirementsacrossabroadrangeofteammembers.ThischallengecompoundsaswemoveintotheworldoflooselycoupledXMLWebservices.Itiscommonknowledgethatthepresentationofconceptsandinformationinmultipleformats―visual,spoken,written―enhancespeoplesabilitytounderstandmessagesquicklyandaccurately.Takingthismultiple-formatapproachtocommunicating,VisualStudio.NEThelpsfosterteamcoordinationandproductivitybyprovidingarichsetofvisualmodelingtoolsforspecifyingapplicationarchitectureandrequirements.

AnIndustry-StandardApproach
VisualStudio.NETdeliverssupportforafullrangeofdesignandmodelingactivities,includingfreeformdiagrammingcapabilitiesaswellasasetofindustry-standardUnifiedModelingLanguage(UML)diagrams.UMLisanotationforvisuallydescribingandinterpretingthepieces,relationships,andactionsthatcompriseasoftwareapplication.

WiththeVisualStudio.NETmodelingfeatures,userscancreatesophisticateddiagramstospecifytheirapplicationarchitectureandbusinessrequirements,andcancommunicatetheseacrosstheirteams.Businessanalysts,architects,developers―andotherswhowanttoperformanalysisanddesigntaskstoenhancecommunicationandincreasetheproductivityoftheirdevelopmentteams―cantakeadvantageofthesenewcapabilities.ThefollowingscenariodemonstrateshowthestructureofaparticularsoftwaresystemcanbevisualizedandmoreeffectivelycommunicatedbyusingsoftwaremodelscreatedinVisualStudio.NET.

ApplicationScenario:ACarRentalSoftwareSystem
ThisscenariodiscusseshowtheeightUMLdiagramtypesmightbeusedtomodelacarrentalagencyssoftwaresystem.Beginningwiththreesimpleusecases,theexamplescapturethecoreprocessesinthesystem.

UseCaseDiagram
Ausecasespecifiesaninteractionbetweenauserandthesysteminwhichtheuserisabletoachieveagoal.Atypicalsoftwaresystemmightincludehundredsofsimpleusecases.Someusecasesapplicabletotherentalagencyssystemare:

Customerreservescar
Beforeobtainingacar,acustomermustmakeareservation.Thecustomercontactstherentalagencyandmakesarequest.Theagencyacceptsordeclinestherequestbasedonanumberofcriteria,suchastheavailabilityofcarsorthecustomersrentalhistory.Ifthereservationisaccepted,theagencycompletesaformcontainingcustomerdetails.Paymentofadepositcompletesthereservation.
Customerpicksupcar
Whenthecustomerarrivesattheagency,therentalagencyallocatesthemodelofcarrequestedbythecustomer,dependingoncurrentstocklevels.Afterpayingthefullfee,thecustomerreceivesthecar.
Customerreturnscar
Thecustomerreturnsthecartotheagencyonthedayspecifiedintherentalagreement.
Thefollowingimagedepictstheuse-casediagramforthesethreeusecases.


Figure1.Asimpleusecasediagram

StaticStructure(Class)Diagram
Thenexttaskistoclassifytheobjectsinvolvedandtheirrelationships.Examiningusecaseshelpsidentifyclasses.Classesofobjectsaremodeledusingstaticstructure,orclass,diagramsthatshowtheoverallstructureofthesystem,aswellasrelationalandbehavioralproperties.

Inaclassdiagram,theobjectsinvolvedinthecarrentalsystemaregroupedintoclasses.Eachclasscontainsanamesectionandanattributesection.Someclassesalsoincludeanoperationssection,whichspecifieshowobjectswithinthatclassmaybehave.

IntheCustomerclass,attributesincludename,telephonenumber,driverslicensenumber,andaddress.Thedateofbirthisrequiredtodeterminethatthecustomermeetstheminimumagerequirementtorentavehicle.TheCustomerclassalsostoresoperations,suchasreservations.

Classdiagramssupportinheritance.Inthefollowingfigure,forexample,theMechanicandRentalAgentclassesinheritattributes,suchasnameandaddress,fromtheEmployeeclass.


Figure2.Astaticstructure,orclass,diagram

SequenceDiagram
Asequencediagramprovidesadetailedviewofausecase.Itshowsaninteractionarrangedinasequenceovertime,andhelpstodocumenttheflowoflogicwithintheapplication.Theparticipantsareshowninthecontextofthemessagesthatpassbetweenthem.Inacomprehensivesoftwaresystem,thesequencediagramcanbequitedetailed,andcanincludethousandsofmessages.

Supposethatacustomerwantstoreserveacar.Therentalagentmustfirstcheckthecustomersrecordstoensurethatthecustomermaydoso.Ifthecustomerhasrentedacarfromthecompanybefore,hisorherrentalhistorywillalreadyberecorded,andtheagentneedonlyensurethatallprevioustransactionsransmoothly.Forexample,theagentcanconfirmthatthecustomerspreviousrentalcarswerereturnedontime.Oncethecustomersrentalstatusisapproved,therentalagentcanapprovethecarrentalreservation.Thisprocesscanberepresentedinasequencediagram,asshowninthefigurebelow.


Figure3.Asequencediagram

CollaborationDiagram
Acollaborationdiagramisanothertypeofinteractiondiagram.Likeasequencediagram,itshowshowagroupofobjectsinausecaseworkwithoneanother.Eachmessageisnumberedtodocumenttheorderinwhichitoccurs.


Figure4.Acollaborationdiagram

StatechartDiagram
Anobjectsstateisdefinedasitsattributesataparticularmoment.Objectsmovethroughvariousstatesastheyareinfluencedbyoutsidestimuli.Thestatechartdiagrammapsthesestates,aswellasthetriggeringeventsthatcausetheobjecttobeinaparticularstate.Forexample,inourrentalsystem,theobjectisacar.Asacarmovesthroughtherentalsystem,itsmanystatesproduceacomplexbutilluminatingdiagram.Forexample,itisfirstaddedtothefleet.ItremainsinthestateInStockuntilitisrented.Afterrenting,thecarisreturnedtothefleetandtotheInStockstate.Atvarioustimesinitscommerciallife,thecarmayrequirerepairs(InService).Whenthecarreachestheendofitsusefulness,itiseithersoldorscrappedtomakewayforanewvehicle.


Figure5.Astatechartdiagram

ActivityDiagram
Anactivitydiagramdisplaysthelogicthatoccursinresponsetointernallygeneratedactions.Anactivitydiagramrelatestoaspecificclassorusecase,andshowsthestepsinvolvedincarryingoutaparticularoperation.


Figure6.Anactivitydiagram

ComponentDiagram
Acomponentdiagramshowshowvarioussoftwaresubsystemsmakeuptheoverallstructureofthesystem,whichisbuiltonacentralizeddatabasethatcontainspastrentalrecords,cardetails,servicerecords,andcustomerandemployeedetails.Itiscriticalthatthisdatabecentralizedinonedatabase,becausestocklevelsvarybythehourandallpartiesmusthaveup-to-theminuteinformation.Keepingthedatacurrentrequiresreal-timeinformationupdatesbyallparties.ThesoftwaresubsystemsforthisexampleincludeCarRecords,ServiceRecords,SalesRecords,CustomerRecords,andEmployeeRecords.


Figure7.Acomponentdiagram

DeploymentDiagram
Adeploymentdiagramshowshowthehardwareandsoftwareinthesystemareconfigured.Therentalagencyneedsaclient/serversystemwithacentraldatabaseofrecordsthatthestaffcanaccess.Rentalagentsneedaccesstothedataonvehicleavailability.Meanwhile,mechanicsneedtobeabletoflagaparticularcarasbeingintheInServicestate.


Figure8.Adeploymentdiagram

FreeformModeling
ManycustomersalsowanttheabilitytoaddothergraphicalelementstotheUMLdiagramsintheirapplicationmodels.VisualStudio.NETenablesfreeformmodeling,suchasflowchartsandothernon-semanticdiagrams,aswellastheabilitytoembedanyimagewithinamodel.Thisprovidescustomerswithadditionalflexibilityincommunicatingtheirapplicationarchitectureandfunctionality.

Summary
Duringtheapplicationlifecycle,manypeopleofvaryingtechnicalbackgroundsneedtointeractandcommunicatetosuccessfullyaccomplishthecommongoalofcreatinganewapplication.VisualStudio.NETprovideskeyfeatures―industrystandardsoftwaremodelingandrichfreeformdiagrammingcapabilities―forspecifyingandcommunicatingarchitecture.Customerswhousethesefeatureswillbenefitthroughmoreeffectivecommunicationwithintheirdevelopmentteams,whichwillincreasetheefficiencyofdevelopersandthesuccessrateofsoftwareprojectsintheirorganizations.
[img=1border=0style=,1src=]http://www.ckuyun.com/[/img]
也不知道,我同学昨天说数据挖掘很好。
简单生活 该用户已被删除
沙发
发表于 2015-1-20 05:33:07 | 只看该作者
ASP在执行的时候,是由IIS调用程序引擎,解释执行嵌在HTML中的ASP代码,最终将结果和原来的HTML一同送往客户端。
精灵巫婆 该用户已被删除
板凳
发表于 2015-1-25 18:19:48 | 只看该作者
由于CGI程序每响应一个客户就会打开一个新的进程,所以,当有多个用户同时进行CGI请求的时候,服务器就会打开多个进程,这样就加重了服务器的负担,使服务器的执行效率变得越来越低下。
分手快乐 该用户已被删除
地板
发表于 2015-2-3 12:46:56 | 只看该作者
但是目前在CGI中使用的最为广泛的是Perl语言。所以,狭义上所指的CGI程序一般都是指Perl程序,一般CGI程序的后缀都是.pl或者.cgi。
若天明 该用户已被删除
5#
发表于 2015-2-9 01:24:39 | 只看该作者
ASP(ActiveServerPages)是Microsfot公司1996年11月推出的WEB应用程序开发技术,它既不是一种程序语言,也不是一种开发工具,而是一种技术框架,不须使用微软的产品就能编写它的代码。
蒙在股里 该用户已被删除
6#
发表于 2015-2-26 17:04:51 | 只看该作者
比如封装性、继承性、多态性等等,这就解决了刚才谈到的ASP的那些弱点。封装性使得代码逻辑清晰,易于管理,并且应用到ASP.Net上就可以使业务逻辑和Html页面分离,这样无论页面原型如何改变。
透明 该用户已被删除
7#
发表于 2015-3-8 16:14:23 | 只看该作者
可以通过在现有ASP应用程序中逐渐添加ASP.NET功能,随时增强ASP应用程序的功能。ASP.NET是一个已编译的、基于.NET的环境,可以用任何与.NET兼容的语言(包括VisualBasic.NET、C#和JScript.NET.)创作应用程序。另外,任何ASP.NET应用程序都可以使用整个.NETFramework。开发人员可以方便地获得这些技术的优点,其中包括托管的公共语言运行库环境、类型安全、继承等等。
灵魂腐蚀 该用户已被删除
8#
发表于 2015-3-16 04:32:40 | 只看该作者
通过这次激烈的讨论,我从大家身上学到了太多,开阔了眼界,不管是支持我的还是骂我的,都感谢你们。
海妖 该用户已被删除
9#
发表于 2015-3-22 20:11:20 | 只看该作者
虽然在形式上JSP和ASP或PHP看上去很相似——都可以被内嵌在HTML代码中。但是,它的执行方式和ASP或PHP完全不同。在JSP被执行的时候,JSP文件被JSP解释器(JSPParser)转换成Servlet代码,然后Servlet代码被Java编译器编译成.class字节文件,这样就由生成的Servlet来对客户端应答。所以,JSP可以看做是Servlet的脚本语言(ScriptLanguage)版。
第二个灵魂 该用户已被删除
10#
发表于 2015-3-22 20:11:20 | 只看该作者
网页从开始简单的hmtl到复杂的服务语言,走过了10多个年头,各种技术层出不穷,单个的主流技术也在不断翻新的版本,现在分析下各种语言的区别、优势、劣势、开发注意事项!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-9-25 20:55

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表