5
How to Draw UML Use Case Diagram There are several approaches on how to draw UML use case diagrams. If you don't know from where to start, try to follow the steps described here. Define Subject Subject is a business, software system, subsystem, component, device, etc. that we are designing or just trying to understand how it is working. It is very important to define what kind of system it is, and what is its scope or boundary. Give it a proper name, and use appropriate stereotype, e.g. «Business» or «Subsystem». For example, we want to describe a Pharmacy, and it is not software pharmacy prescription system but actual pharmacy business. So, we will draw it as shown below, using «Business» stereotype. «Business» Pharmacy as UML subject. Another example of a subject shown below is Ticket vending machine, i.e. vending machine that sells and produces tickets to commuters. This kind of machine is a combination of both hardware and software, and it is only a part of the whole system selling tickets to the customers. So we will use «Subsystem» stereotype. Ticket vending machine as UML subject. Here are some other examples of UML subject name: Department Store Airport Automated Teller Machine (ATM) Point of Sale (POS) Terminal Online Travel Reservation System Electronic Prescription Service By declaring a subject we are defining boundaries of the system, to be able to determine what or who is inside the system, and what or who is outside of it. Define Actors UML actor is some type, group or particular facet of users that require some services from the subject. Actor is an external entity, which could be a human user of the designed system, or some other system or device using our system.

How to Draw UML Use Case Diagram - Determine Subject Boundaries, Define Actors, Describe Use Cases

Embed Size (px)

DESCRIPTION

tip

Citation preview

  • 8/4/2015 HowtoDrawUMLUseCaseDiagramDetermineSubjectBoundaries,DefineActors,DescribeUseCases.

    http://www.umldiagrams.org/usecasediagramshowto.html 1/5

    HowtoDrawUMLUseCaseDiagramThereareseveralapproachesonhowtodrawUMLusecasediagrams.Ifyoudon'tknowfromwheretostart,trytofollowthestepsdescribedhere.

    DefineSubjectSubjectisabusiness,softwaresystem,subsystem,component,device,etc.thatwearedesigningorjusttryingtounderstandhowitisworking.Itisveryimportanttodefinewhatkindofsystemitis,andwhatisitsscopeorboundary.Giveitapropername,anduseappropriatestereotype,e.g.BusinessorSubsystem.

    Forexample,wewanttodescribeaPharmacy,anditisnotsoftwarepharmacyprescriptionsystembutactualpharmacybusiness.So,wewilldrawitasshownbelow,usingBusinessstereotype.

    BusinessPharmacyasUMLsubject.

    AnotherexampleofasubjectshownbelowisTicketvendingmachine,i.e.vendingmachinethatsellsandproducesticketstocommuters.Thiskindofmachineisacombinationofbothhardwareandsoftware,anditisonlyapartofthewholesystemsellingticketstothecustomers.SowewilluseSubsystemstereotype.

    TicketvendingmachineasUMLsubject.

    HerearesomeotherexamplesofUMLsubjectname:DepartmentStoreAirportAutomatedTellerMachine(ATM)PointofSale(POS)TerminalOnlineTravelReservationSystemElectronicPrescriptionService

    Bydeclaringasubjectwearedefiningboundariesofthesystem,tobeabletodeterminewhatorwhoisinsidethesystem,andwhatorwhoisoutsideofit.

    DefineActorsUMLactorissometype,grouporparticularfacetofusersthatrequiresomeservicesfromthesubject.Actorisanexternalentity,whichcouldbeahumanuserofthedesignedsystem,orsomeothersystemordeviceusingoursystem.

  • 8/4/2015 HowtoDrawUMLUseCaseDiagramDetermineSubjectBoundaries,DefineActors,DescribeUseCases.

    http://www.umldiagrams.org/usecasediagramshowto.html 2/5

    ForthePharmacybusinesswedefinedabove,Customerisanexampleofanactor.Customerusesservicesprovidedbypharmacy.Pharmacistworkinginthepharmacyisnotanactor,heorsheispartofthebusinessandisusuallycalledbusinessworker.

    CustomerisabusinessactorforthePharmacybusiness.

    Ticketvendingmachineallowscommuterstobuytickets.SoCommuterisouractorinthiscase.

    Commuterisanactorfortheticketvendingmachine.

    Actorsshouldhavenamesaccordingtotheroletheyplayinrelationtooursystem.Examplesofactornames(userroles):SupplierPassengerReceptionistWebClientBankPaymentAuthorizationSystem

    DefineUseCasesNowaswedefinedtheboundariesofthesystemthatwearedesigningoranalysing,andexternalusersofthesystem,weneedtodefinewhatdothoseusersneedfromthesystem.Eachusecasespecifiesaunitofcompleteandusefulfunctionalitythatthesubjectprovidestotheactor(s).Usecaseshouldreflectuserneedsandgoals,andshouldbeinitiatedbyanactor.

    Forthepharmacycustomerabusinessusecasewouldbetogetsomemedicine.SoweareaddingProcureMedicinesbusinessusecase.BusinessactorCustomerparticipatinginthebusinessusecaseshouldbeconnectedtotheusecasebyassociation.

    BusinessusecaseProcureMedicinesfortheCustomerofthePharmacybusiness.

    TheultimategoaloftheCommuterinrelationtoourticketvendingmachineistobuyaticket.SoweareaddingPurchaseTicketusecase.Purchasingticketmightinvolveabank,ifpaymentistobemadeusingadebitorcreditcard.SowearealsoaddinganotheractorBank.Bothactorsparticipatingintheusecaseshouldbeconnectedtotheusecasebyassociation.

  • 8/4/2015 HowtoDrawUMLUseCaseDiagramDetermineSubjectBoundaries,DefineActors,DescribeUseCases.

    http://www.umldiagrams.org/usecasediagramshowto.html 3/5

    TicketvendingmachineprovidesPurchaseTicketusecasefortheCommuterandBankactors.

    Toplevelusecasesshoulddescribecompleteunitoffunctionalityprovidedtotheactor.Examplesofusecasenames:HireEmployeeTransferFundsFindBookMakeTravelReservationsSchedulePatientAppointment

    DescribeUseCaseBehaviorsUsecasebehaviorsmaybedescribedinanaturallanguagetext(opaquebehavior),whichiscurrentcommonpractice,orbyusingUMLbehaviordiagramsforspecificbehaviorssuchasactivity,statemachine,interaction.

    UMLtoolsshouldallowlinkingbehaviorstothedescribedusecase.ExampleofsuchbindingofausecasetothebehaviorrepresentedbyactivityisshownbelowusingUML2.5notation.

    PurchaseTicketusecaseownsbehaviorrepresentedbyPurchaseTicketactivity.

    PurchaseTicketactivitydiagramexamplebelowdescribesbehaviorofthePurchaseTicketusecase.

  • 8/4/2015 HowtoDrawUMLUseCaseDiagramDetermineSubjectBoundaries,DefineActors,DescribeUseCases.

    http://www.umldiagrams.org/usecasediagramshowto.html 4/5

    ExampleofPurchaseTicketusecasebehaviordescribedusingactivitydiagram.

    Usecasediagramsexamples

    Noticedaspellingerror?SelectthetextusingthemouseandpressCtrl+Enter.

    Disqusseemstobetakinglongerthanusual.Reload?

    Follow@uml_diagrams

    umldiagrams.org2129Megusta

    0

    byKirillFakhroutdinovThisdocumentdescribesUML2.5andisbasedonOMGUnifiedModelingLanguage(OMGUML)2.5specification [UML2.5FTFBeta1].AllUMLdiagramswerecreatedinMicrosoftVisio2007or2010using UML2.2stencils.Youcansendyourcommentsandsuggestionstowebmasteratwebmaster@umldiagrams.org.

  • 8/4/2015 HowtoDrawUMLUseCaseDiagramDetermineSubjectBoundaries,DefineActors,DescribeUseCases.

    http://www.umldiagrams.org/usecasediagramshowto.html 5/5

    Copyright20092014umldiagrams.org.Allrightsreserved.