加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 UML面向对象建模与设计(第二版)习题解答

UML面向对象建模与设计(第二版)习题解答.pdf

UML面向对象建模与设计(第二版)习题解答

fishing
2013-03-29 0人阅读 举报 0 0 暂无简介

简介:本文档为《UML面向对象建模与设计(第二版)习题解答pdf》,可适用于高等教育领域

AnswerKeytoObjectOrientedModelingandDesignwithUML,SecondEditionMichaelBlahaModelsoftConsultingCorporationJamesRumbaughIBMPearsonPrenticeHallUpperSaddleRiver,NewJersey阎鹏飞iiiªbyPearsonEducation,IncUpperSaddleRiver,NewJerseyTheauthorandpublisherofthisbookhaveusedtheirbesteffortsinpreparingthisbookTheseeffortsincludethedevelopment,research,andtestingofthetheoriesandprogramstodeterminetheireffectivenessTheauthorandpublishermakenowarrantyofanykind,expressedorimplied,withregardtotheseprogramsorthedocumentationcontainedinthisbookTheauthorandpublishershallnotbeliableinanyeventforincidentalorconsequentialdamagesinconnectionwith,orarisingoutof,thefurnishing,performance,oruseoftheseprogramsAllrightsreservedNopartofthisbookmaybereproduced,inanyformorbyanymeans,withoutpermissioninwritingfromthepublisherPrintedintheUnitedStatesofAmerica阎鹏飞vContentsChapterIntroductionPart:ModelingConceptsChapterModelingasaDesignTechniqueChapterClassModelingChapterAdvancedClassModelingChapterStateModelingChapterAdvancedStateModelingChapterInteractionModelingChapterAdvancedInteractionModelingChapterConceptsSummaryPart:AnalysisandDesignChapterProcessOverviewChapterSystemConceptionChapterDomainAnalysisChapterApplicationAnalysisChapterSystemDesignChapterClassDesignChapterProcessSummary阎鹏飞viPart:ImplementationChapterImplementationModelingChapterOOLanguagesChapterDatabasesChapterProgrammingStyle阎鹏飞IntroductionTherearenorightorwronganswerstothefirstfourexercises,whichareintendedtogiveyousomefeedbackonthebackgroundofthestudentsandtogetthemthinkingaboutthevalueofusingasoftwaredesignmethodologyTheamountoftimespentonanalysis,design,coding,andtestingdebuggingfixingdependsonthemethodologyusedUsinganOOapproach,wefindthatoureffortissplitapproximatelyonanalysis,ondesign,oncoding,andontestingdebuggingfixingproblemsTheexactsplitdependsonfactorssuchasthetypeofsystemandtheamountofexperiencewithsimilarsystemsWehavefoundthatpayingextraattentiontoanalysisanddesigncutsthetotaldevelopmenttimeItisaloteasiertoavoidaproblemduringanalysisanddesignthanitistofindandfixitlateronOneofthemostdifficultareasofprojectmanagementisestimatinghowmucheffortaprojectwillrequireOnemethodthatweuseistobreakthetotaleffortdownintoseveraltasksWethinkabouteachtaskseparatelyandestimatehowmucheffortisrequired,basedonourexperiencewithsimilartasksOnemajorproblemthatwehaveencounteredisunderestimatingthetimeandeffortrequiredtocompleteaprojectMostsoftwareprojectsarefinishedlateandoverbudgetWetrytodealwiththisbycarefullyconsideringourestimatesandexplicitlyallowingforcontingenciesPrematureimplementationisanotherproblemBecauseofananxietytocompleteaproject,developerssometimessubstituteimplementationfordesign,resultinginsystemsthatarehardtodebugTheresultingsoftwaresuffersfromunwarrantedassumptionsandfuzzythinkingWithsuchanapproach,developersbogdownindetailsandfinditdifficulttoseeflawsInoneofourprojectswequicklyprototypedatrivialmasterslavecommunicationssystemWedidtheinitialcodinginaweekwithoutbenefitofathoughtfuldesignTheresultingsystemcrashedduetooccasionaldatacommunicationserrorsWeappliedmanypatchestothesystemoveraperiodofthreemonthsEachtimewethoughtweun阎鹏飞ChapterIntroductionderstoodtheproblemonlytofindthatwereallydidnotTheproblemseducedusintoinvestigatingmanydeadendsWefinallyscrappedourinitialdesignandstartedoveragainWeputmorethinkingintoourseconddesignandsuccessfullycompletedthecommunicationssystemAnotherproblemweoftenfaceisuncertainorchangingrequirementsForexample,anotheroneofourprojectschangeditshardwareplatformseveraltimesduringthecourseoftheproject,fromaPCtoaworkstationandthenbacktoaPCEachtime,weportedanuncompletedsystem,wastingtimeandeffortThiscontributedtothefailureoftheprojectWhatweshouldhavedonewascompletethesystemononeplatformfirstandportittootherplatformslaterExpectawiderangeofanswerstothisquestionHereisananswerbasedononeofourearlyapplicationsatGERDWecreatedaneditorforpowersystemcircuitdiagramsthatservedasagraphicalfrontendforcapturingparametersneededforsimulatingtheirperformanceOurmainobstaclewasintegratingseveralsubsystemsoverwhichwehadnocontrolWeusedastructuredanalysisanddesignmethodologythatsomeoneelseselectedoverourobjectionsWewouldhavepreferredarapidprototypingapproachThefocalpointofthesystemwasadatabase,whichwedesignedusingOOtechniquesAlthoughtheprojectfailed,wesalvagedseveralgoodideasforotherprojectsExpectavarietyofanswersManysoftwaresystemssufferfromtheseproblems,includingthesystemdescribedinthepreviousanswer,whichwasbehindscheduleandoverbudgetContributingfactorswerepressurestounderestimatetheeffortandthedecisiontobuildthesystemontopofseveralsubsystemsthatwerebeingdevelopedseparatelyDevelopmentofoneofthesubsystems,agraphicalinterface,ranintoproblemsofitsown,anddidnotbecomeavailableuntilafterthetargetcompletiondateofoursystemThepointofthisexerciseisforthestudentstorealizethatitiseasytocreatesystemsthatannoyusers,andtomotivatethemtoconsidertheuser’spositionSoftwaresystemsthattruncatenamesisoneofourpetpeevesTruncationcancausemanyunexpectedproblemsOnecheckissuingsystemtruncatesfirstnamestolettersandlastnamestoletters,resultinginchecksthatsomebanksrefusetocashThiscouldhavebeenavoidedbyabetterdesignAnotherannoyingsituationisthehandlingofforeigncurrencybyvendingmachinesChangedispensedbybillchangingmachinesmaycontainforeigncurrencythatisrefusedbyadjacentfoodvendingmachinesaAddressescanbeusedtoidentifymailrecipientsTheformatofanaddress,whichvarieswithcountry,oftenincludesname,street,city,stateprovince,postalcode,andcountryAnaddressbothidentifiestherecipientofmailandencodesinstructionsforitsdelivery阎鹏飞ChapterAnswerstoExercisesbCriminalinvestigationscanusecombinationsofphotographs,fingerprinting,bloodtyping,DNAanalysis,anddentalrecordstoidentifypeople,livingandordeceased,whoareinvolvedin,orthesubjectof,acriminalinvestigationcBankscanuseavarietyofschemestoidentifysafedepositcustomersUsuallynameplussomeotherpieceofinformationsuchasanaccountnumber,driver’slicense,oraddressisusedOtheranswersarepossibledTelephonenumbersareadequateforidentifyingalmostanytelephoneintheworldIngeneralatelephonenumberconsistsofacountrycodeplusaprovince,city,orareacode,plusalocalnumberplusanoptionalextensionnumberBusinessesmayhavetheirowntelephonesystemswithotherconventionsDependingontherelativelocationofthetelephonethatyouarecalling,partsofthenumbermaybeimpliedandcanbeleftout,butextraaccessdigitsmayberequiredtocalloutsidethelocalregionInNorthAmericamostlocalcallsrequiredigitsLongdistancecallsinNorthAmericauseanaccessdigit(or)areacode(digits)localnumber(digits)DialingParisrequiresanaccesscode()countrycode()citycode()localnumber(digits)TheaccesscodeisnotpartoftheidentifiereAccountscanbeusedbytelephonecompaniesforbillingpurposesAsingleaccountmaybeforoneorforseveraltelephonenumbersAccountinformationincludesaccountID,name,andaddressTheaccountIDidentifiestheaccountOneofthetelephonenumbersintheaccountcouldbeusedintheconstructionoftheIDAbillfortheserviceprovidedtoallofthetelephonenumbersinanaccountcanbesenttotheaccountaddressfTherearelogicalaswellasphysicalelectronicmailaddressesusedinelectronicnetworksTheformatsdependontheparticularnetworkAphysicaladdressisasequenceofbytesassignedtoahardwaredevicesuchasaworkstationoracomputeratthetimeofitsmanufacture,anduniquelyidentifiesthedeviceAlogicaladdressidentifiesauseronasystemOntheInternettherearedomainnames(suchasedu,org,andcom)OrganizationnamesareuniquewithinadomainanduserswithinanorganizationThussomeemailaddressesareblahacomputerorgandrumbaughusibmcomgOnewaythatemployeesaregivenrestricted,afterhoursaccesstoacompanyisthroughtheuseofaspecial,electronicallyreadablecardOfcourse,ifanemployeelosesacardanddoesnotreportit,someonewhofindsitcoulduseitforunauthorizedentryOtherapproachesincludeapictureIDwhichrequiresinspectionbyaguard,fingerprintreaders,andvoicerecognitionExpectawidevarietyofanswersThepointoftheexerciseisforthestudenttobegintothinkintermsofclassesaClassesthatyouwouldexpectinaprogramfornewspaperlayoutincludePage,Column,Line,Headline,andParagraphbClassesthatyouwouldexpectinaprogramtocomputeandstorebowlingscoresincludeBowler,Frame,Pin,Score,andBallWithinFrame阎鹏飞ChapterIntroductioncSomeclassesforvoicemailincludeTelephone,Greeting,Message,andDistributionListdClassesforacontrollerforavideocassetterecorderincludeTimer,Channel,Tapedeck,andTVeForacatalogstoreorderentrysystem,classesincludeCustomer,Order,Store,andItemForavariablelengtharraytheoperationsbehaveasfollows:nAppendaddsanobjecttotheendofanarrayDuplicatesareallowednCopymakesacopyofanarrayAllvaluesinthearrayelementsarecopiedbuttheobjectsreferencedarenotcopiedrecursivelynCountreturnsthenumberofelementsinanarraynDeleteremovesanelementfromanarrayThepositionoftheelementtobedeletedmustbespecifiedAllhighernumberedelementsareshifteddownbyonepositionIfthepositionisoutofrange,theoperationisignoredTheoperationreturnsthechangeinsizeofthearray,ifdeletionoccurs,otherwisenIndexretrievesanobjectfromanarrayatagivenpositionisreturnediftheindexisoutofrangenIntersectisnotdefinedforarraysnInsertplacesanobjectintoanarrayatagivenpositionAllelementsatthegivenindexorhigherareshiftedupbyonepositionAnerrormessageisprintedifthepositionisoutofrangenUpdateplacesanobjectintoanarrayatagivenposition,overwritingwhateveristhereIfthepositionisoutofrange,thearrayisextendedwithsTheoperationreturnsthechangeinthesizeofthearrayForasymboltable(alsoknownasadictionary)theoperationsbehaveasfollows:nAppendmakessenseonlyforsortedtables,inwhichcaseanentrygoesattheendunlessthetablealreadycontainsthekeywordInthatcasethenewentryreplacestheoldentryDuplicatesarenotallowedTheoperationreturnsthechangeinthesizeofthetablenCopymakesacopyofatablenCountreturnsthenumberofentriesinatablenDeleteremovesanentryfromatableTheentrytobedeletedisspecifiedbykeywordIftheentrydoesnotexisttheoperationisignoredTheoperationreturnsthechangeinthesizeofthetablenIndexretrievesanentryfromatablethatmatchesagivenkeywordnIntersectisnotdefinedforsymboltablesnInsertisnotdefinedforsymboltablesUseupdateinstead阎鹏飞ChapterAnswerstoExercisesnUpdateaddsanentrytoatableIfthekeywordisnotyetinthetable,anewentryismadeIfthekeywordisalreadyinthetable,theentryinthetableisupdatedTheoperationreturnsthechangeinthesizeofthetableOperationsonsetsbehaveasfollows:nAppendisnotdefinedforaset,sinceelementsofasetarenotorderednCopymakesacopyofasetnCountreturnsthenumberofelementsinasetnDeleteremovesagivenelementofasetIftheelementdoesnotexisttheoperationisignoredTheoperationreturnsthechangeinthesizeofthesetnIndexisnotdefinedforasetnIntersectperformssetintersectionoftwogivensets,creatinganewsetnInsertisnotdefinedforsetsUseupdateinsteadnUpdateaddsanelementtoasetIftheelementisnotyetintheset,itisaddedtothesetIfitisalreadyintheset,theoperationisignoredTheoperationreturnsthechangeinthesizeofthesetAddingmoreclassestoeachlistisoptionalWehavegivenafewclassestogetthestudenttothinkabstractlyWemadenoattempttogiveexhaustivelistsintheexerciseaElectronmicroscopes,eyeglasses,telescopes,bombsights,andbinocularsarealldevicesthatenhancevisioninsomewayWiththeexceptionofthescanningelectronmicroscope,allthesedevicesworkbyreflectingorrefractinglightEyeglassesandbinocularsaredesignedforusewithtwoeyestherestoftheobjectsonthelistaredesignedforusewithoneeyeTelescopes,bombsights,andbinocularsareusedtoviewthingsfarawayAmicroscopeisusedtomagnifysomethingthatisverysmallEyeglassesmayenlargeorreduce,dependingonwhethertheprescriptionisforanearsightedorafarsightedpersonSomeotherclassesthatcouldbeincludedinthislistareopticalmicroscopes,cameras,andmagnifyingglassesbPipes,checkvalves,faucets,filters,andpressuregaugesareallplumbingsupplieswithcertaintemperatureandpressureratingsCompatibilitywithvarioustypesoffluidsisalsoaconsiderationCheckvalvesandfaucetsmaybeusedtocontrolflowWiththeexceptionofthepressuregauge,alloftheitemslistedhavetwoendsandhaveapressureflowcharacteristicforagivenfluidAlloftheitemsarepassiveSomeotherclassesincludepumps,tanks,andconnectorscTheseobjectsareallmeansfortransportationBicycles,cars,trucks,motorcycles,andhorsesareusedonlandSailboatsareusedonwaterAirplanesandglidersareusedintheairStudentsmaydiscoverothercommontraitsdTheseareallfastenersThetermsscrewandbolthavesimilarmeaningsThetermscrewisusedtorefertowoodscrews,selftappingsheetmetalscrews,andboltsThetermbolt阎鹏飞ChapterIntroductionreferstoastraightthreadedscrewNails,screws,andboltsareusedforcarpentryBoltsandrivetsareusedintheassemblyofmachineryeTheseareallformsofshelterAnyofthemaffordprotectionfromtherainPeoplenormallyliveinhousesorskyscrapers,althoughtherestwoulddoinanemergencyTents,sheds,garages,barns,houses,andskyscrapersaremanmadeCavesarenaturalAllexcepttentsaremoreorlesspermanentstructuresGarages,barns,sheds,andhousesaretypicallymadeoutofwood,brick,orsheetmetalSkyscrapersrequirespecialconstructiontechniquesSheds,garages,andbarnsareusedtostorethings阎鹏飞Part:ModelingConceptsModelingasaDesignTechniqueThefirstfourexercisesemphasizethatthecontentofamodelisdrivenbyitsrelevancetotheproblemtobesolvedThefirstthreeexercisesarehardwareorientedExerciseissoftwareorientedInpurchasingatireforacar,sizeisgenerallyconstrainedtofitthecarInselectingtires,manyconsumerspaycloseattentiontocostandexpectedlifeTreaddesignandinternalconstructionarebroadlymatchedtotheexpectedserviceForexamplesnowtiresprovideextratractioninsnowMaterialandweightaregenerallynotconsideredSize,material,internalconstruction,treaddesign,andweightareimportantphysicalparametersthatwouldbetakenintoaccountinsimulatingtheperformanceofacomputerizedantiskidsystemforcarsOtherphysicalparametersofthecaritselfwouldhavetobeconsideredCostandexpectedlifewouldbeirrelevantInbuildingatireswingforachild,costwouldprobablybethemainconsiderationAdiscardedtirewouldbeagoodcandidateWeightandsizewouldalsoberelevantYouwouldprobablynotuseagianttrucktireforaswing,althoughyoumightuseitinconstructingaplaygroundCost,stiffness,availability,andstrengthwouldbeconsideredinselectingawiretounclogadrainDependingontheurgencyofthesituation,youmightprefersomethingimmediatelyavailableIfyouwentouttobuysomethingyouwouldnotwanttopaymoreforthewirethanwhatitwouldcosttohireaplumberThewirewouldhavetobestiffenoughtopushthroughtheclogbutwouldhavetobeflexibleenoughtofollowthebendsofthedrainpipeWehavenothadmuchluckuncloggingdrainswithmostcommonwiresuchascoathangerwireorelectricalwireWehavehadsomemodestsuccesswithaspecialcoiledspringsoldinsomehardwarestoresandwithchemicalcausticsForreallytoughjobsyoushouldhireaplumber阎鹏飞ChapterModelingasaDesignTechniqueaForatransatlanticcable,resistancetosaltwateristhemainconsiderationThecablemustlieunmaintainedatthebottomoftheoceanforalongtimeInteractionofoceanlifewiththecableandtheeffectofpressureandsalinityoncablelifemustbeconsideredTheratioofstrengthweightisimportanttoavoidbreakagewhilethecableisbeinginstalledCostisanimportanteconomicfactorElectricalparametersareimportantforpowerconsumptionandsignaldistortionbColor,cost,stiffness,andavailabilityarethemainconsiderationsYouwouldprobablywantanassortmentofcolorstomaketheartworkinterestingThewireshouldbestiffenoughtoholditsshapeafterbeingbent,butflexibleenoughtobeshapedcWeightisveryimportantforwirethatistobeusedintheelectricalsystemofanairplane,becauseitaffectsthetotalweightoftheplaneToughnessoftheinsulationisimportanttoresistchafing

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/45

UML面向对象建模与设计(第二版)习题解答

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利