uml overview - dagbladet -...
TRANSCRIPT
Hans-PetterHalvorsen,M.Sc.
UML
O.W
idde
r.(201
3).geek&
poke.A
vailable:http://geek-and
-poke.com
UnifiedModelingLanguage
RequirementsAnalysis
Design
Implementation
Testing
Maintenance
Planning
TheSoftwareDevelopment
Lifecycle(SDLC)
Deployment
DocumentsinSoftwareDevelopmentHigh-Level
RequirementsandDesignDocuments
UserManuals
SystemDocumentation
InstallationGuides
TestPlans
TestDocumentation
DetailedRequirementsandDesignDocuments
ERDiagramUMLDiagrams
FinalReport
Time
ProjectStart
ProjectFinish
HowtoTest/WhattoTest
CADDrawings
1.Planning
2.Testing
3.End-userDocumentation
4.Handover(Business people)
(Thepeoplethatshallactuallyusethesoftware)
TechnicalStuff
Howtouseit
Howtoinstallit
Proofthatyouhavetestedandthatthesoftwareworksasexpected
(stakeholders,thesoftwareteam;architects,UXdesigners,developers)
(QApeople)
(SuperUser/ITdep.)
WHAT
HOW
(EndUser)
UnifiedModelingLanguage(UML)
• Amodelinglanguageusedinsoftwareengineering
• VerypopularwithinOOA,OOD,OOP• Developedinthe1990s• UMLwasadaptedasanISOstandardin2000• UML2.2has14differenttypesofdiagrams
OOA=ObjectOrientedAnalysis,OOD=ObjectOrientedDesign,OOP=ObjectOrientedProgramming
UMLDiagrams
• Klassediagram (ClassDiagram)• Komponentdiagram (ComponentDiagram)• Produksjonssettingsdiagram (DeploymentDiagram)• Objektdiagram (ObjectDiagram)• Pakkediagram (PackageDiagram)• Aktivitetsdiagram (ActivityDiagram)• Sekvensdiagram (SequenceDiagram)• Samhandlingsdiagram (CommunicationDiagram),forenklet versjon av
UML1.xCollaborationDiagram• Bruksmønserdiagram (UseCaseDiagram)• Tilstandsdiagram (StateMachineDiagram)• Sammensatt strukturdiagram (CompositeStructureDiagram)(UML2.0)• Interaksjonsoversiktsdiagram (InteractionOverviewDiagram)(UML2.0)• Tidsforløpsdiagram (TimingDiagram)(UML2.0)
7
UMLDiagrams
2categories:1. StructureDiagrams– …
2. BehaviorDiagrams– …– InteractionDiagrams(ASubsetofBehaviorDiagrams)– …
8
UseCase
9[http://en.wikipedia.org/wiki/Use_case]
UseCaseExampleforaRestaurant:
Ausecaseisalistofsteps,typicallydefininginteractionsbetweenarole(knowninUMLasan"actor")andasystem,toachieveagoal.
Theactorcanbeahumanoranexternalsystem.
ClassInheritance
14
Whenaclassinheritsfromanotherclass,itautomaticallygetsallitsattributesandmethods.IfclassAinheritsfromclassB,wecallclassAthesuperclassandclassBthesubclass.Inheritancerelationshipisan“is-a”relationshipbetweenthesubclassandthesuperclass.Althoughthesubclasscanoverrideanymethoditinheritsfromthesuperclass,changingitsbehavior,theintentistomostlyaddadditionalmethods.
WhyuseUML?• Design– ForwardDesign:doingUMLbeforecoding.Makesiteasiertocreatethecodeinastrucuredmanner
– BackwardDesign:doingUMLaftercodingasdocumentation
– WhendoingchangesintheDesign,makesuretoupdatetheCodeaccordingtothenewDesign
• Code– SomeToolscanAutogenerateCodefromUMLdiagrams
– WhendoingchangesintheCode,makesuretoupdatetheUMLDiagrams
15
UseCaseandScrum(Agile)
• TheTeamworkscloesly togetherwiththeProductOwner
• Lessneedfordetaileddescriptionsandrequirements
• Agile/ScrumusesUserStoriesinstead(whichcouldbeconsideredasalightversionofUseCase)
• TheUserStoriesarethebasefortheProductBacklogandtheSprintBacklog
16
UMLSoftware
• MSVisio• EnterpriseArchitect• StarUML• RationalRose• VisualStudioEnterprise• etc.(hundredsdifferentalternatives)
17
UMLinVisualStudioEnterprise
18http://channel9.msdn.com/Series/Visual-Studio-2012-Premium-and-Ultimate-Overview/Visual-Studio-Ultimate-2012-Improving-architecture-through-modeling
UMLExercise- Solutions
+“Kjøp Ringetid”
Etuse case(bruksmønsterdiagram)erenbeskrivelseavhvordansystemetoppnåretmålavverdiforenaktør.Bruksmønsterdiagrammer(Use Casediagrams)brukestilåbeskriveinteraksjonenmellombrukereogsystemer.Bruksmønstrebeskriverinteraksjonenmellometsystemogeksterneaktører.
Summary
• ItisimportanttocreateDesignandSpecifications(includingUML)before youstartCoding
• ButUMLcanalsobeusedtodocumentyourcodeafterwards
• UMLdiagramsisageneralmethod/standardtodojustthat
• Thismakesiteasiertocreatestructuredcode• Agoodwaytodocumentyourcodeproperly.• Coderefactoring:UseUMLaspartofthecontinuouscodeimprovementsprocess
21
References• Wikipedia.(2013).UnifiedModelingLanguage.Available:
http://en.wikipedia.org/wiki/Unified_Modeling_Language• I.Sommerville,SoftwareEngineering:Pearson,2010.• Wikipedia.(2013).ScrumDevelopment.Available:
http://en.wikipedia.org/wiki/Scrum_(development)• S.Adams.Dilbert.Available:http://dilbert.com• O.Widder.(2013).geek&poke.Available:http://geek-and-poke.com• B.Lund.(2013).Lunch.Available:http://www.lunchstriper.no,
http://www.dagbladet.no/tegneserie/lunch/
22
Hans-PetterHalvorsen,M.Sc.
UniversityCollegeofSoutheastNorwaywww.usn.no
E-mail:[email protected]:http://home.hit.no/~hansha/