7 Object-oriented Analysis Reading: Chapter 7 Nov 6, 8, 13
7 Announcements x Blackboard/WEBCT 6.0 q http://blackboard.ilstu.edu q Exam scores have been uploaded q However, weighted scores have NOT been computed yet x We wil have key term quiz next week (Nov 15) x Homework # is out (on Nov 13) Systems Analysis and Design in a Changing World, 4th Edition 2
7 Learning Objectives x Develop use case diagrams x Write use case and scenario descriptions x Develop activity diagrams and system sequence diagrams x Develop state machine diagrams to model object behavior x Explain how UML diagrams work together to define functional requirements for the object-oriented approach Systems Analysis and Design in a Changing World, 4th Edition 3
7 Overview x Objective of requirements definition is understanding users’ needs, business processes, and system to support business processes x Understand and define requirements for a new system using object-oriented analysis models and techniques x Line between object-oriented analysis and object- oriented design is somewhat fuzzy q Iterative approach to development q Models built in analysis are refined during design Systems Analysis and Design in a Changing World, 4th Edition 4
7 Object-Oriented Requirements x Object-oriented modeling notation is Unified Modeling Language (UML 2.0) x UML was accepted by Object Management Group (OMG) as standard modeling technique x Purpose of Object Management Group q Promote theory and practice of object-oriented technology for development of distributed systems q Provide common architectural framework for OO Systems Analysis and Design in a Changing World, 4th Edition 5
7 Object-Oriented Requirements (continued) x Object-oriented system requirements are specified and documented through process of building models x Modeling process starts with identification of use cases and problem domain classes (things in users’ work environment) x Business events trigger elementary business processes (EBP) that new system must address as use cases x Use cases define functional requirements Systems Analysis and Design in a Changing World, 4th Edition 6
7 Object-Oriented Requirements Models x Use case diagrams – identify actors and their use cases (goals) x Use case descriptions – include details of a use case and how actors use the system x Activity diagrams – describe user and system activities for a use case x Systems sequence diagrams (SSDs) – define inputs and outputs and sequence of interactions between user and system for a use case x State machine diagrams – describe states of each object Systems Analysis and Design in a Changing World, 4th Edition 7
7 Requirements Models—Traditional versus OO (Figure 7-1) Systems Analysis and Design in a Changing World, 4th Edition 8
7 Relationships Between OO Requirements Models (Figure 7-28) Systems Analysis and Design in a Changing World, 4th Edition 9
7 Example of use case diagram Systems Analysis and Design in a Changing World, 4th Edition 10
7 Example of use case description Systems Analysis and Design in a Changing World, 4th Edition 11
7 Example of Activity Diagram— (Figure 7-12) Systems Analysis and Design in a Changing World, 4th Edition 12
7 Example of system sequence diagram (Figure 7-18) Systems Analysis and Design in a Changing World, 4th Edition 13
7 The System Activities— A Use Case/Scenario View x Use case analysis used to identify and define all business processes that system must support x Use case – an activity a system carried out, usual y in response to a user request x Actor q Role played by user q Outside automation boundary Systems Analysis and Design in a Changing World, 4th Edition 14
7 Techniques for Identifying Use Cases (Review from Chapter 5) x Identify user goals q Each goal at the elementary business process (EBP) level is a use case q EBP – task performed by one user in one place and in response to business event that adds measurable business value, and leaves system and data in consistent state x Event decomposition technique (event table) x CRUD analysis technique (create, read/report, update, delete) to ensure coverage Systems Analysis and Design in a Changing World, 4th Edition 15
7 Use Case Diagram x Graphical UML diagram that summarizes information about actors and use cases x Simple diagram shows overview of functional requirements x Can have multiple use case diagrams q By subsystem q By actor Systems Analysis and Design in a Changing World, 4th Edition 16
7 Simple Use Case with an Actor (Figure 7-2) Systems Analysis and Design in a Changing World, 4th Edition 17
7 Use Case Diagram with Automation Boundary and Alternate Actor Notation (Figure 7-3) Systems Analysis and Design in a Changing World, 4th Edition 18
7 All Use Cases Involving Customer as Actor (Figure 7-4) Systems Analysis and Design in a Changing World, 4th Edition 19
7 Use Cases of RMO Order Entry Subsystem (Partial Figure 7-5 with package symbol) Systems Analysis and Design in a Changing World, 4th Edition 20
7 <<Includes>> Relationship x Documents situation in which one use case requires the services of a common subroutine x Another use case is developed for this common subroutine x A common use case can be reused by multiple use cases Systems Analysis and Design in a Changing World, 4th Edition 21
7 Example of Order-Entry Subsystem with <<Includes>> Use Cases (Figure 7-6) Systems Analysis and Design in a Changing World, 4th Edition 22
7 CRUD Analysis for Identifying/Confirming Use Cases x CRUD – create, read/report, update, delete x Information Engineering (IE) technique to identify event table or directly develop use case diagram x Compares identified use cases with domain model class diagram x Every class in class diagram must have use cases to support creating, reading, reporting, updating, and deleting object instances x Confirms system integration requirements Systems Analysis and Design in a Changing World, 4th Edition 23
7 Use Case Description x Use case description provides details of preconditions, postconditions, sequence of activities, and exception conditions in use case x Describes actor interacting with computer system step-by- step to carry out business activity x May have several scenarios for a use case, each a specific use case instance x Three levels of detail: brief, intermediate, and ful y developed description x Many analysts prefer to write narrative descriptions of use cases instead of drawing activity diagrams Systems Analysis and Design in a Changing World, 4th Edition 24
7 Brief Description of Create New Order Use Case (Figure 7-7) Systems Analysis and Design in a Changing World, 4th Edition 25
7 Intermediate Description of the Telephone Order Scenario for Create New Order Use Case (Figure 7-8) Systems Analysis and Design in a Changing World, 4th Edition 26
7 Intermediate Description of the Web Order Scenario for Create New Order (Figure 7-9) Systems Analysis and Design in a Changing World, 4th Edition 27
7 Fully Developed Description of Telephone Order Scenario for Create New Order Use Case (Figure 7-10) Systems Analysis and Design in a Changing World, 4th Edition 28
7 Top Detail from Fully Developed Use Case Description (Figure 7-10) Systems Analysis and Design in a Changing World, 4th Edition 29
7 Middle Detail from Fully Developed Use Case Description (Figure 7-10) Systems Analysis and Design in a Changing World, 4th Edition 30
7 Bottom Detail from Fully Developed Use Case Description (Figure 7-10) Systems Analysis and Design in a Changing World, 4th Edition 31
7 Use Case Description Components x Use case name/scenario name x Actors/stakeholders x Related use cases x Preconditions – set of criteria that must be true prior to initiation of the use case x Postconditions – set of criteria that must be true upon completion of the use case x Flow of activities (steps in one column or two) x Exception conditions Systems Analysis and Design in a Changing World, 4th Edition 32
7 Activity Diagrams x Used to document workflow of business process activities for each use case or scenario x Standard UML 2.0 diagram as seen in Chapter 4 x Can support any level of use case description; a supplement to use case descriptions x Helpful in developing system sequence diagrams Systems Analysis and Design in a Changing World, 4th Edition 33
7 Activity Diagram— Telephone Order Scenario (Figure 7-12) Systems Analysis and Design in a Changing World, 4th Edition 34
7 Activity Diagram— Web Order Scenario (Figure 7-13) Systems Analysis and Design in a Changing World, 4th Edition 35
7 Identifying Inputs and Outputs— The System Sequence Diagram x System sequence diagram (SSD) is type of UML 2.0 interaction diagram x Used to model input and output messaging requirements for a use case or scenario x Shows actor interacting with system x Shows sequence of interactions as messages during flow of activities x System is shown as one object: a “black box” Systems Analysis and Design in a Changing World, 4th Edition 36
7 System Sequence Diagram (SSD) Notation (Figure 7-14) Systems Analysis and Design in a Changing World, 4th Edition 37
7 SSD Notation x Actor represented by a stick figure – a person (or role) that interacts with system by entering input data and receiving output data x Object is a rectangle with name of object underlined – shows individual object and not class of all similar objects ( :System for SSD ) x Lifeline or object lifeline is a vertical line under object or actor to show passage of time for object x Message is labeled on arrows to show messages sent to or received by actor or system Systems Analysis and Design in a Changing World, 4th Edition 38
7 SSD Lifelines x Vertical line under object or actor q Shows passage of time x If vertical line dashed q Creation and destruction of thing is not important for scenario x Long narrow rectangles q Activation lifelines emphasize that object is active only during part of scenario Systems Analysis and Design in a Changing World, 4th Edition 39
7 SSD Messages x Internal events identified by the flow of objects in a scenario x Requests from one actor or object to another to do some action x Invoke a particular method Systems Analysis and Design in a Changing World, 4th Edition 40
7 Repeating Message (Figure 7-15) Systems Analysis and Design in a Changing World, 4th Edition 41
7 Developing a System Sequence Diagram x Begin with detailed description of use case from ful y developed form or activity diagram x Identify input messages x Describe message from external actor to system using message notation x Identify and add any special conditions on input message, including iteration and true/false conditions x Identify and add output return messages Systems Analysis and Design in a Changing World, 4th Edition 42
7 Activity Diagram and Resulting SSD for Telephone Order Scenario (Figures 7-16 and 7-17) Systems Analysis and Design in a Changing World, 4th Edition 43
7 SSD of the Web Order Scenario for the Create New Order Use Case (Figure 7-18) Systems Analysis and Design in a Changing World, 4th Edition 44
7 Identifying Object Behavior— The State Machine Diagram x State machine diagram is UML 2.0 diagram that models object states and transitions q Complex problem domain classes can be modeled x State of an object q A condition that occurs during its life when it satisfies some criterion, performs some action, or waits for an event q Each state has unique name and is a semipermanent condition or status x Transition q The movement of an object from one state to another state Systems Analysis and Design in a Changing World, 4th Edition 45
7 Simple State Machine Diagram for a Printer (Figure 7-19) Copy to board! Systems Analysis and Design in a Changing World, 4th Edition 46
7 State Machine Terminology x Pseudo state – the starting point of a state machine, indicated by a black dot x Origin state – the original state of an object from which the transition occurs x Destination state – the state to which an object moves after the completion of a transition x Message event – the trigger for a transition, which causes the object to leave the origin state x Guard condition – a true/false test to see whether a transition can fire x Action expression – a description of the activities performed as part of a transition Systems Analysis and Design in a Changing World, 4th Edition 47
7 RMO State Machine Diagram for OrderItem Problem Domain Class Systems Analysis and Design in a Changing World, 4th Edition 48
7 Composite States and Concurrency— States within a State Systems Analysis and Design in a Changing World, 4th Edition 49
7 Concurrent Paths for Printer in the On State (Figure 7-21) Systems Analysis and Design in a Changing World, 4th Edition 50
7 Rules for Developing State Machine Diagram x Review domain class diagram, select important ones, and list all state and exit conditions x Begin building state machine diagram fragments for each class x Sequence fragments in correct order and review for independent and concurrent paths x Expand each transition with message event, guard-condition, and action-expression x Review and test each state machine diagram Systems Analysis and Design in a Changing World, 4th Edition 51
7 Order Domain Class for RMO— States and Exit Transitions (Figure 7-25) Systems Analysis and Design in a Changing World, 4th Edition 52
7 First-Cut State Machine Diagram for Order (Figure 7-26) Systems Analysis and Design in a Changing World, 4th Edition 53
7 Second-Cut State Machine Diagram for Order (Figure 7-26) Systems Analysis and Design in a Changing World, 4th Edition 54
7 Integrating Object-Oriented Models x Complete use case diagram is needed to understand total scope of new system x Domain model class diagrams should also be as complete as possible for entire system x With iterative approach, only construct use case descriptions, activity diagrams, and system sequence diagrams for use cases in iteration x Development of a new diagram often helps refine and correct previous diagrams Systems Analysis and Design in a Changing World, 4th Edition 55
7 Relationships Between OO Requirements Models (Figure 7-28) Systems Analysis and Design in a Changing World, 4th Edition 56
7 Summary x Object-oriented approach has complete set of diagrams that define system requirements x Requirements specified using fol owing models q Domain model class diagram (Chapter 5) q Use case diagrams (Chapter 7) q Use case detailed models, either descriptive formats or activity diagrams (Chapter 7) q System sequence diagrams (Chapter 7) q State machine diagrams (Chapter 7) Systems Analysis and Design in a Changing World, 4th Edition 57
7 RMO Event Table (Figure 5-6 partial) MultipleResponses! Systems Analysis and Design in a Changing World, 4th Edition 58