Presentation is loading. Please wait.

Presentation is loading. Please wait.

Use Case Diagrams. Use cases modeling Overview Motivation Communication between developers and users Users don’t know system, developers don’t know users’

Similar presentations


Presentation on theme: "Use Case Diagrams. Use cases modeling Overview Motivation Communication between developers and users Users don’t know system, developers don’t know users’"— Presentation transcript:

1 Use Case Diagrams

2 Use cases modeling Overview Motivation Communication between developers and users Users don’t know system, developers don’t know users’ work Users’ requirement needs to be clearly defined agreement between user and developer is necessary. Use case Visual model both users and developers can easily understand

3 Use Case Modeling system modeling from user’s perspective A way to define functional requirements from user Easy to understand Normally done during system analysis step Implementation issue is not considered Increase the probability of making a system user really wants

4 Use Case Use case A view to system seen from outside User’s requirements on system A set of scenario for an actor to achieve useful works Bank clientBank system Withdraw Transfer Balance check deposit

5 Basic Concepts Actor An external person, process or thing interacting with a system, subsystem, or class User Case Each describes a possible kind of interaction between an actor and the system Use cases are actions that a user takes on a system System The entity that we are going to build Can have subsystems in it Relationship Connection between actors and use cases or use cases and use cases. The first represents communication, the second represents higher level relationship

6 Actors a user of the system Can be a person or another system Identify the actors in terms of their roles – not their names Actor is shown with a stick figure

7 Use Case Use cases are actions users take on the system can be very high level or so fine-grained that they cannot contain any other functionality Use “verb” or “verb+noun” style naming Notation Characteristics Describes how a system can be used by an actor Represents services provided by a system User requirements borrowreturn

8 System System refers to the module that performs the function Use case diagram could show a part of the system, referred to as a subsystem System or the sybsystem is shown as a rectangle enclosing the use cases, with the system name in the rectangle Library System

9 Relationship (Use Case Diagram) There are four kinds of relationships Association Extend Include generalization

10 Association Relationship Shown by a line connecting actors to use cases An Actor can relate to many use cases and a use case can relate to many actors

11 Include Relationship Between a use case and another use case use case A includes the functionality of use case B (has-a relationship) A B >

12 Extend Relationship Use case can be extended by another use case At the extension point, use case is extended Extension point Shows the exact extension point between the two use cases Shows the actual logic necessary for one use case to extend another

13 Example : Extend Relationship

14 Generalization Relationship Indicate an inheritance of an item in UML Can be applied to actors as well as use cases

15 Creating Use Case Diagrams There are five tasks involved in creating use case diagrams 1. Identify actors of the system. Identify use cases of the system. Identify the relationships. 2. Prioritize the use cases if necessary. 3. Detail each use case. Describe Basic flow and Alternative flows for each use case 4. Identify generalizations. Identify include relationships. Identify extend relationships. 5. Create use case diagram.

16 Example

17 Example

18

19

20 Activity Diagram

21 What is Activity Diagram Shows overall flow of control (just like flowchart) A simplified look at what happens during a process Business and operational step-by-step workflows of components in a system

22 Activity Diagram Notations

23 Decision Activity1 Activity2 Wake Up Eat BreakfastGo Back to Sleep [hungry][Not hungry] Wake Up Eat BreakfastGo Back to Sleep [hungry][Not hungry] Transition from one activity to another Two ways of showing a decision

24 Concurrent Path, Signal Work Out ShowerRelax Television Show New Channel Change (channel) Press Channel Number Change(channel) Remote.keyln(channel) Watch Concurrent Path Signal : when received, the signal causes an activity to take place (send : convex, receive : concave ) Synchronization bar

25 Example of Activity Diagram A Process : Creating a Document 1. Open the word processing package 2. Create a file 3. Save the file under a unique name within its directory 4. Type the document 5. If graphics are necessary, open the graphics package, create the graphics, and paste the graphics into the document 6. If spreadsheet are necessary, open the spreadsheet package, create the spreadsheet, and paste the spreadsheet into the document 7. Save the file 8. Print a hard copy of the document 9. Exit the office suite

26 활동 다이어그램 Open Word Processing Package Create File Save File Type the Document Open and Use Graphics Package Open and Use Spreedsheet Save File Print Hardcopy Exit Office Suite [graphics needed] [graphics not needed] [tables needed] [tables not needed]

27 show who has responsibility for each activity. (role) 1.A salesperson calls the client and sets up an appointment 2.Onsite appointment(In the consulting firm’s office) - corporate technicians prepare a conference room for a presentation 3.Offsite appointment(at the client’s office) - a consultant prepares a presentation on a laptop 4.The consultant and the salesperson meet with the client at the agreed-upon location and time 5.the salesperson follows up with a letter 6.If the meeting has resulted in a statement of a problem, the benefit – the activities of each role are clarified Swimlanes 9

28 Call client and set up appointment Prepare a conference room Prepare a laptop [appointment onsite] [appointment offsite] Meet with the client Send followup letter Create proposal Send proposal to client See the Activity Diagram for Creating a Document [statement of problem] [no statement problem] 10 AD

29 Call client and set up appointment Prepare a conference room Prepare a laptop [appointment onsite] [appointment offsite] Meet with the client Send followup letter Create proposal Send proposal to client [statement of problem] [no statement problem] See the Activity Diagram for Creating a Document Sales PersonConsultantCorporate Technician AD with Swimlane

30 Example

31 State Diagram

32 Objects change their state in response to events State Diagram presents the states an object can be transitions between the states and Starting point Endpoint Difference from class diagram, use case diagram changes over time represents states of a single object

33 State Diagram Components State Icon, Transition, Starting Point, Endpoint State Icon : State Name(Required), Activity Activity : Event and Action entry : what happens when the system enters the state exit : what happens when the system leaves the state do : what happens while the system is in the state Transition : Change states, arrow Occurs in response to trigger event Event and action => separated by ‘/’ triggerless transition guard condition => Boolean expression

34 Notation state name state variable activity event / action or [guard condition ] Event / action or [guard condition]

35 Basic UML State Diagram top ReadyReady stop /ctr := 0stop StateState TriggerTrigger ActionAction InitialpseudostateInitialpseudostate TransitionTransition FinalstateFinalstate DoneDone “top” state

36 PC State Diagram

37 Example1 : flashing lamp LampFlashingLampFlashing 1sec/ FlashOffFlashOff entry/lamp.off()FlashOnFlashOnentry/lamp.on() off/ LampOffLampOffentry/lamp.off() LampOnLampOn entry/lamp.on() on/ flash/ on/ Default transition to the initial pseudostate Default transition to the initial pseudostate Group transition

38 Example2 : dialing

39 ex3 : login of an online banking system

40 Substates Sequential substates Concurrent substates

41 Activity Diagram vs State Diagram State Diagram A clear picture of the changes in the object’s state in a process Activity Diagram Flow chart : flow of activity of a process

42 Sequence Diagram

43 Purpose of Sequence Diagram to show the interactions between objects in the sequential order shows the sequence of messages for a particular task from a use case diagram Understand how objects in system interact with each other Understand how use case(scenario) can be refined with detailed information Use cases are often refined into one or more sequence diagrams

44 Sequence Diagram Time, object, and message Lifeline and activation :Name Notation

45 Basics Focus on order in which messages occur :Name1:Name2 lifeline activation message object objects time

46 Messages The first message starts at the top, typically located on the left side Subsequent messages are then added to the diagram slightly lower then the previous message Messages can be sent to itself : synchronous call operation : method on the arrow : asynchronous signal : return message (optional) : return value on the arrow

47 An example of messages being sent between objects The system object calling its determineAvailableReports method

48 Synchronous vs asynchronous

49 guards Used when a condition must be met for a message to be sent

50 Combined fragment A combined fragment is used to group sets of messages together to show conditional flow in a sequence diagram Alternatives Options loops

51 alternatives Design mutually exclusive choice between two or more message sequences

52 option Model a sequence that occur when a certain condition is satisfied

53 loops model a repetitive sequence

54 Sequence diagram example Object Message Activation Time constraint Comment

55 Example

56 Sequence Diagram : Why Useful? shows the interaction logic between the objects in the system in the time order that the interactions take place.

57 Communication Diagram

58 Class diagrams indicates what classes are part of our system, what they offer, how they relate, but they don’t tell us how they communicate. Communication diagrams show (used to model) how objects interact and their roles. Similar to Sequence Diagrams. Communication Diagram := Class Diagram + Sequence diagram Sequence Diagrams are arranged according to Time. Communication Diagrams represent the structural organization of object. Both Sequence and Communication diagrams are called interaction diagrams

59 Communication diagram Objects interact to perform some task Links (messages) which show associations between objects Similar to sequence diagram arrows Actors from the use case diagrams

60 Symbols :Name1 :Name2 :Name3 1:Add() 2:Modify() 3:Update() Numbering : The order of messages ex) 1,2,3, …, 3.1, 3.2

61 Example

62 Ex) Soda Machine : Simple Scenario

63 Ex) Soda Machine : Complex Scenario


Download ppt "Use Case Diagrams. Use cases modeling Overview Motivation Communication between developers and users Users don’t know system, developers don’t know users’"

Similar presentations


Ads by Google