UML统一建模语言重点高品质.docx
《UML统一建模语言重点高品质.docx》由会员分享,可在线阅读,更多相关《UML统一建模语言重点高品质.docx(18页珍藏版)》请在冰豆网上搜索。
UML统一建模语言重点高品质
Chapter1Introduction
1.Model&advantage
2.Modeling
Modelingisaprovenandwell-acceptedengineeringtechniquewhichhelpsbuildamodel.Modelisasimplificationofreality;
Itisablueprintoftheactualsystemthatneedstobebuilt
3.Principlesofmodeling
Thechoiceofwhatmodelstocreatehasaprofoundinfluenceonhowaproblemisattackedandhowasolutionisshaped.
Everymodelmaybeexpressedatdifferentlevelsofprecision.
Thebestmodelsareconnectedtoreality.
Nosinglemodelorviewissufficient.Weneedmultipleviewpoints.
4.Typesofmodeling
Majorthreetypesofmodelingare
Structural,
Behavioral,and
Architectural
5.WhatisUML
TheUnifiedModelingLanguage(UML)isastandardlanguageforwritingsoftwareblueprints.
TheUMLmaybeusedtovisualize,specify,construct,anddocumenttheartifactsofasoftwaresystem.
6.WherecantheUMLbeused?
EnterpriseInformationsystems
BankingandFinancialservices
Telecommunications
Transportations
Defense/Aerospace
Retail
MedicalElectronics
Scientific
DistributedWeb-basedservices
7.GoalsofUML
Todefinesomegeneralpurposemodelinglanguagewhichallmodelerscanuseandalsoitneedstobemadesimpletounderstandanduse.
UMLdiagramsarenotonlymadefordevelopersbutalsoforbusinessusers,commonpeopleandanybodyinterestedtounderstandthesystem.
Thesystemcanbeasoftwareornonsoftware.SoitmustbeclearthatUMLisnotadevelopmentmethodratheritaccompanieswithprocessestomakeasuccessfulsystem.
AttheconclusionthegoalofUMLcanbedefinedasasimplemodelingmechanismtomodelallpossiblepracticalsystemsintoday'scomplexenvironment.
8.UMLbuildingblocks
Things,relationships,diagrams
9.Architecturalviews
Architecturereferstothedifferentperspectivesfromwhichacomplexsystemcanbeviewed.
Thearchitectureofasoftware-intensivesystemisbestdescribedbyfiveinterlockingviews:
–Usecaseview:
systemasseenbyusers,analystsandtesters.
–Designview:
classes,interfacesandcollaborationsthatmakeupthesystem.
–Processview:
activeclasses(threads).
–Implementationview:
filesthatcomprisethesystem.
–Deploymentview:
nodesonwhichSWresides.
UMLplaysanimportantroleindefiningdifferentperspectivesofasystem.Theseperspectivesare:
•Designview
•Implementationview
•Processview
•Deploymentview
Andthecentreisthe UseCase viewwhichconnectsallthesefour
Chapter2Diagrams
1.UMLstandarddiagrams
●InthepreviouschapterswehavediscussedabouttheintroductiontoUML,basicbuildingblocksandothernecessaryelementsofUML.
●Nowweneedtounderstandwheretousethoseelements.
●TheelementsarelikecomponentswhichcanbeassociatedindifferentwaystomakeacompleteUMLpictureswhichisknownasdiagram.
●Soitisveryimportanttounderstandthedifferentdiagramstoimplementtheknowledgeinreallifesystems.
●Anycomplexsystemisbestunderstoodbymakingsomekindofdiagramsorpictures.
●Thesediagramshaveabetterimpactonourunderstanding.
●Soifwelookaroundthenwewillrealizethatthediagramsarenotanewconceptbutitisusedwidelyindifferentformindifferentindustries.
●WeprepareUMLdiagramstounderstandasysteminbetterandsimpleway.
●Asinglediagramisnotenoughtocoverallaspectsofthesystem.
●SoUMLdefinesvariouskindsofdiagramstocovermostoftheaspectsofasystem.
●Therearetwobroadcategoriesofdiagramsandthenareagaindividedintosub-categories:
●StructuralDiagrams
●BehavioralDiagrams
2.Categoriesofdiagrams
Structuraldiagrams
●The structuraldiagrams representthestaticaspectofthesystem.
●Thesestaticpartsarerepresentsbyclasses,interfaces,objects,componentsandnodes.
●Thefourstructuraldiagramsare:
1.Classdiagram
2.Objectdiagram
3.Componentdiagram
4.Deploymentdiagram
Behavioraldiagrams
●Anysystemcanhavetwoaspects,staticanddynamic.
●Soamodelisconsideredascompletewhenboththeaspectsarecoveredfully.
●Behavioraldiagramsbasicallycapturethedynamicaspectofasystem.
●Dynamicaspectcanbefurtherdescribedasthechanging/movingpartsofasystem.
●UMLhasthefollowingfivetypesofbehavioraldiagrams:
●Usecasediagram
●Sequencediagram
●Collaborationdiagram
●Statechartdiagram
●Activitydiagram
Chapter3ClassDiagram
1.Purposeofclassdiagram
●Thepurposeoftheclassdiagramistomodelthestaticviewofanapplication.
●Theclassdiagramsaretheonlydiagramswhichcanbedirectlymappedwithobjectorientedlanguagesandthuswidelyusedatthetimeofconstruction.
●Sothepurposeoftheclassdiagramcanbesummarizedas:
●Analysisanddesignofthestaticviewofanapplication.
●Describeresponsibilitiesofasystem.
●Baseforcomponentanddeploymentdiagrams.
●Forwardandreverseengineering.
2.Notations(or)Elementsofclassdiagram
Classes
Interfaces
Dependency,generalization,andassociationrelationships
3.Relationships
Dependency
Generalization
Association
Aggregation
Composition
4.Howtodrawclassdiagram
1)ClassdiagramsarethemostpopularUMLdiagramsusedforconstructionofsoftwareapplications.
2)Soitisveryimportanttolearnthedrawingprocedureofclassdiagram.
3)Classdiagramshavelotofpropertiestoconsiderwhiledrawingbutherethediagramwillbeconsideredfromatoplevelview.
4)Classdiagramisbasicallyagraphicalrepresentationofthestaticviewofthesystemandrepresentsdifferentaspectsoftheapplication.
5)Soacollectionofclassdiagramsrepresentthewholesystem
6)Thefollowingpointsshouldberememberedwhiledrawingaclassdiagram:
1Thenameoftheclassdiagramshouldbemeaningfultodescribetheaspectofthesystem.
2Eachelementandtheirrelationshipsshouldbeidentifiedinadvance.
3Responsibility(attributesandmethods)ofeachclassshouldbeclearlyidentified.
④Foreachclassminimumnumberofpropertiesshouldbespecified.Becauseunnecessarypropertieswillmakethediagramcomplicated.
⑤Usenoteswheneverrequiredtodescribesomeaspectofthediagram.Becauseattheendofthedrawingitshouldbeunderstandabletothedeveloper/coder.
⑥Finally,beforemakingthefinalversion,thediagramshouldbedrawnonplainpaperandreworkasmanytimesaspossibletomakeitcorrect.
5.Exampleclassdiagrams
●Nowthefollowingdiagramisanexampleofan OrderSystem ofanapplication.
●Soitdescribesaparticularaspectoftheentireapplication.
●Firstofall Order and Customer areidentifiedasthetwoelementsofthesystemandtheyhavea onetomany relationshipbecauseacustomercanhavemultipleorders.
●Wewouldkeep Order classisanabstractclassandithastwoconcreteclasses(inheritancerelationship) SpecialOrder andNormalOrder.
●Thetwoinheritedclasseshaveallthepropertiesasthe Order class.
●Inadditiontheyhaveadditionalfunctionslike
dispatch() andreceive().
●Sothefollowingclassdiagramhasbeendrawnconsideringallthepointsmentionedabove
+Public#Protected
-Private
6.Wheretouseclassdiagram?
●Classdiagramisastaticdiagramanditisusedtomodelstaticviewofasystem.
●Thestaticviewdescribesthevocabularyofthesystem.
●Classdiagramisalsoconsideredasthefoundationforcomponentanddeploymentdiagrams.
●Classdiagramsarenotonlyusedtovisualizethestaticviewofthesystembuttheyarealsousedtoconstructtheexecutablecodeforforwardandreverseengineeringofanysystem.
●GenerallyUMLdiagramsarenotdirectlymappedwithanyobjectorientedprogramminglanguagesbuttheclassdiagramisanexception.
●ClassdiagramclearlyshowsthemappingwithobjectorientedlanguageslikeJava,C++etc.
●Sofrompracticalexperienceclassdiagramisgenerallyusedforconstructionpurpose.
Soinabrief,classdiagramsareusedfor:
●Describingthestaticviewofthesystem.
●Showingthecollaborationamongtheelementsofthestaticview.
●Describingthefunctionalitiesperformedbythesystem.
●Constructionofsoftwareapplicationsusingobjectorientedlanguages
Chapter4Usecasediagram
1.Whatareusecases?
⏹Ausecaseisatypicalinteractionbetweenauserandacomputersystem
⏹Usecasesdocumentthebehaviorofthesystemfromtheusers'pointsofview
⏹Ausermightbeaperson,anotherinformationsystem,ahardwaredevice,etc
⏹Auserisexternaltothesystem
2.Whatareactors?
Anactorinausecasediagramrepresentsarolethatsomeonemayplay,notanindividualuserofthesystem
Thesamepersoncanbedifferentactors
Thinkaboutrolesratherthanpeopleorjobtitles
Anactorisanyperson,organization,orsystemthatinteractswithapplicationbutisexternaltoit
Notationinausecasediagram
3.ActorRelationships
Generalization
4.Usecasescenario
⏹Usecasescenarioisaspecificexampleofausecase
⏹Ascenarioisaninstanceofausecase,asanobjectisaninstanceofaclass
⏹Ausecasedescribesasetofrelatedscenarios
⏹Foreachusecase:
⏹Whatarethepossiblescenarios?
⏹Whataretherulesforapplyingaparticularscenario?
⏹Tocapturethisinformation,asoftwareengineerwoulduseatextualdescriptionoftheusecase
5.Usecaserelationships
6.Usecasediagram
⏹Showexpectedactorsandusecases
⏹Showwhichactorsdowhichusecases
⏹Showdependencyandinheritanceamongusecases
Chapter5Activitydiagram
1)NotationofActivitydiagram
Activities
Actions
ControlFlow
InitialNode
FinalNode
Transitions
Objects
ObjectFlows
ObjectFlow
Pins
Datastore
2)Activity(or)Action
Anactivityisthespecificationofaparameterizedsequenceofbehav