yanalyzeawildcardproblembeforemovingintodesignand
implementationresultsinanalysisparalysisbecauseyoudon'thaveenoughinformationtosolvethiskindofproblemduringtheanalysisphase.Solvingsuchaproblemrequiresiterationthroughthewholecycle,andthatrequiresrisk-takingbehavior(whichmakessense,becauseyou'retryingtodosomethingnewandthepotentialrewardsarehigher).Itmayseemliketheriskiscompoundedby"rushing"intoapreliminaryimplementation,butitcaninsteadreducetheriskinawild-cardprojectbecauseyou'refindingoutearlywhetheraparticularapproachtotheproblemisviable.Productdevelopmentisriskmanagement.
It'softenproposedthatyou"buildonetothrowaway."WithOOP,youmaystillthrowpartofitaway,butbecausecodeisencapsulatedintoclasses,duringthefirstiterationyouwillinevitablyproducesomeusefulclassdesignsanddevelopsomeworthwhileideasaboutthesystemdesignthatdonotneedtobethrownaway.Thus,thefirstrapidpassataproblemnotonlyproducescriticalinformationforthenextanalysis,design,andimplementationiteration,italsocreatesacodefoundationforthatiteration.
Thatsaid,ifyou'relookingatamethodologythatcontainstremendousdetailandsuggestsmanystepsanddocuments,it'sstilldifficulttoknowwhentostop.Keepinmindwhatyou'retryingtodiscover:
Whataretheobjects?(Howdoyoupartitionyourprojectintoitscomponentparts?)
Whataretheirinterfaces?(Whatmessagesdoyouneedtobeabletosendtoeachobject?)
Ifyoucomeupwithnothingmorethantheobjectsandtheirinterfaces,thenyoucanwriteaprogram.Forvariousreasonsyoumightneedmoredescriptionsanddocumentsthanthis,butyoucan'tgetawaywithanyless.
Theprocesscanbeundertakeninfivephases,andaphase0thatisjusttheinitialcommitmenttousingsomekindofstructure.
Phase0:Makeaplan
Youmustfirstdecidewhatstepsyou'regoingtohaveinyourprocess.Itsoundssimple(infact,allofthissoundssimple)andyetpeopleoftendon'tmakethisdecisionbeforetheystartcoding.Ifyourplanis"let'sjumpinandstartcoding,"fine.(Sometimesthat'sappropriatewhenyouhavewell-understood
problem.)Atleastagreethatthisistheplan.
Youmightalsodecideatthisphasethatsomeadditionalprocessstructureisnecessary,butnotthewholenineyards.Understandablyenough,someprogrammersliketoworkin"vacationmode"inwhichnostructureisimposedontheprocessofdevelopingtheirword;"Itwillbedonewhenit'sdone."Thiscanbeappealingforawhile,butI'vefoundthathavingafewmilestonesalongthewayhelpstofocusandgalvanizeyoureffortsaroundthosemilestonesinsteadofbeingstuckwiththesinglegoalof"finishtheproject."Inaddition,itdividestheprojectintomorebite-sizedpiecesandmakesitseemlessthreatening(plusthemilestonesoffermoreopportunitiesforcelebration).
WhenIbegantostudystorystructure(sothatIwillsomedaywriteanovel)Iwasinitiallyresistanttotheideaofstructure,feelingthatwhenIwroteIsimplyletitflowontothepage.ButIlaterrealizedthatwhenIwriteaboutcomputersthestructureisclearenoughsothatIdon'tthinkmuchaboutit.ButIstillstructuremywork,albeitonlysemi-consciouslyinmyhead.Soevenifyouthinkthatyourplanistojuststartcoding,youstillsomehowgothroughthesubsequentphaseswhileaskingandansweringcertainquestions.
Themissionstatement
Anysystemyoubuild,nomatterhowcomplicated,hasafundamentalpurpose,thebusinessthatit'sin,andthebasicneedthatitsatisfies.Ifyoucanlookpasttheuserinterface,thehardware-orsystem-specificdetails,thecodingalgorithmsandtheefficiencyproblems,youwilleventuallyfindthecoreofitsbeing,simpleandstraightforward.Liketheso-calledhighconceptfromaHollywoodmovie,youcandescribeitinoneoretwosentences.Thispuredescriptionisthestartingpoint.
Thehighconceptisquiteimportantbecauseitsetsthetoneforyourproject;it'samissionstatement.Youwon'tnecessarilygetitrightthefirsttime(youmaybeinalaterphaseoftheprojectbeforeitbecomescompletelyclear),butkeeptryinguntilitfeelsright.Forexample,inanair-trafficcontrolsystemtoaverysmallairfield;perhapsthere'sonlyahumancontrollerornoneatall.Amoreusefulmodelwon'tconcernthesolutionyou'recreatingasmuchasitdescribestheproblem:"Aircraftarrive,unload,serviceandreload,anddepart."
Phase1:Whatarewemaking?
It'snecessarytostayfocusedontheheartofwhatyou'retryingtoaccomplishinthisphase:determinewhatthesystemissupposedtodo.Themostvaluabletoolforthisisacollectionofwhatarecalled"usecases."Usecasesidentifykeyfeaturesinthesystemthatwillrevealsomeofthefundamentalclassesyou'llbeusing.Theseareessentiallydescriptiveanswerstoquestionslike:
"Whowillusethissystem?"
"Whatcanthoseactorsdowiththesystem?"
"Howdoesthisactordothatwiththissystem?"
"Howelsemightthisworkifsomeoneelseweredoingthis,orifthesameactorhadadifferentobjective?"(torevealvariations)
"Whatproblemsmighthappenwhiledoingthiswiththesystem?"(torevealexceptions)
Ifyouaredesigninganauto-teller,forexample,theusecaseforaparticularaspectofthefunctionalityofthesystemisabletodescribewhattheauto-tellerdoesineverypossiblesituation.Eachofthese"situations"isreferredtoasascenario,andausecasecanbeconsideredacollectionofscenarios.Youcanthinkofascenarioasaquestionthatstartswith:"Whatdoesthesystemdoif...?"Forexample,"Whatdoestheauto-tellerdoifacustomerhasjustdepositedacheckwithin24hoursandthere'snotenoughintheaccountwithoutthechecktoprovidethedesiredwithdrawal?"
Usecasediagramsareintentionallysimpletopreventyoufromgettingboggeddowninsystemimplementationdetailsprematurely:
Theusecasesproducetherequirementsspecificationsbydeterminingalltheinteractionsthattheusermayhavewiththesystem.Youtrytodiscoverafullsetofusecasesforyoursystems,andonceyou'vedonethatyouhavethecoreofwhatthesystemissupposedtodo.Thenicethingaboutfocusingonusecasesisthattheyalwaysbringyoubacktotheessentialsandkeepyoufromdriftingoffintoissuesthataren'tcriticalforgettingthejobdone.Thatis,ifyouhaveafullsetofusecasesyoucandescribeyoursystemandmoveontothenextphase.Youprobablywon'tgetitallfiguredoutperfectlyonthefirsttry,butthat'sOK.Everythingwillrevealitselfintime,andifyoudemandaperfectsystemspecification
atthispointyou'llgetstuck.
Phase2:Howwillwebuildit?
Inthisphaseyoumustcomeupwithadesignthatdescribeswhattheclasseslooklikeandhowtheywillinteract.Anexcel
上一篇:
vb电表管理系统vb+access源代码+可执行程序+论文(论文和程序)
下一篇:
关于连续型条件属性的模糊规则约简算法