Object Modeling Approach! Object Modeling Approach!

Similar documents
Ajitha Rajan. Inf2C-SE Summary Lecture

Object Modeling Approach

Module 7. Software Engineering Issues. Version 2 EE IIT, Kharagpur 1

State modeling. Marlon Dumas. Institute of Computer Science

Lecture 05: High-Level Design with SysML. An Introduction to SysML. Where are we? What is a model? The Unified Modeling Language (UML)

Smarter Working Through Process Improvement

Object-Oriented Analysis and Design

Actions and Activities

Agile modeling for INF5150

An object-oriented design process. Weather system description. Layered architecture. Process stages. System context and models of use

UML modeling for INF5150

Information System Design IT60105

PART FIVE: SOME VERIFICATION CHALLENGES

1 Descriptions of Function

Geo-enabling a Transactional Real Estate Management System A case study from the Minnesota Dept. of Transportation

Extensibility Patterns: Extension Access

Keeping well and healthy when it is really cold

Operating instructions for electronics

Safety and Liveness. Thread Synchronization: Too Much Milk. Critical Sections. A Really Cool Theorem

An Introduction to Electricity and Circuits

Hierarchical Anomaly Detection in Load Testing with StormRunner Load

Combinational logic systems

Module - 19 Gated Latches

Property of Monitronics Inc

Clojure Concurrency Constructs, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014

STAY WARM STAY WELL STAY SAFE

Robert D. Borchert GIS Technician

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Automation in Complex Systems MIE090

Appendix 4 Weather. Weather Providers

SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version

Welcome to GST 101: Introduction to Geospatial Technology. This course will introduce you to Geographic Information Systems (GIS), cartography,

Newton s Laws of Motion

LAB 2 - ONE DIMENSIONAL MOTION

TRAITS to put you on the map

BROOMFIELD SCHOOL GCSE Physics Long Answer Exam Booklet

RC Circuits. 1. Designing a time delay circuit. Introduction. In this lab you will explore RC circuits. Introduction

Computer Science, Informatik 4 Communication and Distributed Systems. Simulation. Discrete-Event System Simulation. Dr.

Experiment P-5 Motion of a Cart on an Inclined Plane

Duration of online examination will be of 1 Hour 20 minutes (80 minutes).

Today s A/C systems include:

Precision Circuits Inc

Operating instructions Magnetic-inductive flow sensor SM6004 SM7004 SM / / 2014

Bomb Threat Risk Factors Prevention Strategies White level inspections

Year 7 Recall Booklet. Name: Class:

CLASS NOTES: BUSINESS CALCULUS

Chapter 2: Object Oriented Analysis. 1.0 Building Domain/Conceptual Models

Information System Design IT60105

Outline F eria AADL behavior 1/ 78

JOB REQUESTS C H A P T E R 3. Overview. Objectives

Rotational Motion. Figure 1: Torsional harmonic oscillator. The locations of the rotor and fiber are indicated.

Designing a Thermostat Worksheet

Investigation #2 TEMPERATURE VS. HEAT. Part I

The Light Ghost. We were contacted by T.A.P.S (The Atlantic Paranormal Society), they forwarded the following e mail:

This page intentionally left blank.

The Geodetic Infrastructure Management Via Web-Based Mapping Technology in Morocco

Sequential Pattern Mining

AP Final Review II Exploring Data (20% 30%)

Laboratory Exercise. Newton s Second Law

Design Example: 4-bit Sequence Detector

Sample. Contents SECTION 1: PLACE NAMES 6 SECTION 2: CONNECTING TO PLACES 21 SECTION 3: SPACES: NEAR AND FAR 53

TECHNICAL MANUAL 820 LX / 910 LX / 1300 LX

CS 347 Parallel and Distributed Data Processing

CONTENTS. Batteries. La Crosse Technology, Ltd Page 1

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3

Name Date Time to Complete

Lasentec Product Group

Linear Functions, Equations, and Inequalities

Parts II-V Sabbatical Leave Report

An Introduction to GLIF

Process Control and Instrumentation Prof. D. Sarkar Department of Chemical Engineering Indian Institute of Technology, Kharagpur

ENV208/ENV508 Applied GIS. Week 1: What is GIS?

Pain-Free Melting Point Determination. James Lee, Ph.D. Stanford Research Systems

UML Model Refactoring

Wireless Network Security Spring 2015

GAP CLOSING. Algebraic Expressions. Intermediate / Senior Facilitator s Guide

Design Patterns for Metamodel Design

Operating instructions Magnetic-inductive flow meter SM6x04 SM7x04 SM8x04

Regression Analysis. BUS 735: Business Decision Making and Research

Formal Conformance Testing 2006

Cognitive Engineering for Geographic Information Science

Failure detectors Introduction CHAPTER

Algorithms and Complexity theory

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur


Static and Kinetic Friction

Bust-A-Myth Particles of Matter and Heat Transfer. Students will use the online Research Gadget and experimentation to bust or confirm the myth:

ArcGIS for Desktop. ArcGIS for Desktop is the primary authoring tool for the ArcGIS platform.

CSE370 HW3 Solutions (Winter 2010)

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

Laboratory Exercise #8 Introduction to Sequential Logic

Business Process Management

1 Introduction. 1.1 The Problem Domain. Self-Stablization UC Davis Earl Barr. Lecture 1 Introduction Winter 2007

Sample questions for COMP-424 final exam

DATA MINING - 1DL105, 1DL111

MP3 Digital Voice Module Model No.: VCM-SD Rev.A3. Content

Binary Decision Diagrams and Symbolic Model Checking

Steve Pietersen Office Telephone No

3 Types of Heat Transfer

Infrared Experiments of Thermal Energy and Heat Transfer

Transcription:

Object Modeling Approach! 1 Object Modeling Approach! Start with a problem statement! High-level requirements! Define object model! Identify objects and classes! Prepare data dictionary! Identify associations and aggregations! Identify attributes of objects and links! Organize and simplify using inheritance! Iterate and refine the model! Group classes into modules! 2 (Cheng) 1

The Home Heating System! Water Pump Water Valve Hot Water Burner Controller Home Fuel Valve 90 80 Off Fuel 70 60 50 On Control Panel Temp Sensor 3 Home Heating equirements! The purpose of the software for the Home Heating System is to control the heating system that heats the rooms of a house. The software shall maintain the temperature of each room within a specified range by controlling the heat flow to individual rooms. The software shall control the heat in each room! The room shall be heated when the temperature is 2F below desired temp! The room shall no longer be heated when the temperature is 2F above desired temp! The flow of heat to each room shall be individually controlled by opening and closing its water valve! The valve shall be open when the room needs heat and closed otherwise! The user shall set the desired temperature on the thermostat! The operator shall be able to turn the heating system on and off! The furnace must not run when the system is off! When the furnace is not running and a room needs heat, the software shall turn the furnace on! To turn the furnace on the software shall follow these steps! open the fuel valve! turn the burner on! The software shall turn the furnace off when heat is no longer needed in any room! To turn the furnace off the software shall follow these steps! close fuel valve! turn burner off! 4 (Cheng) 2

Identify Object Classes! equirements Statements Extract Nouns Tentative Object Classes Eliminate Spurious Classes Object Classes Water Pump Candidate Classes Controller Hot Water operator Home Heating System house furnace thermostat Burner room Water Valve heating system Fuel Valve temperature heat software desired temp Home Fuel Temp Sensor on-off switch Control Panel range 5 Eliminate Bad Classes! edundant classes! Classes that represent the same thing with different words! Irrelevant classes! Classes we simply do not care about! Vague classes! Classes with ill-defined boundaries! Attributes! Things that describe individual objects! Operations! Sequences of actions are often mistaken for classes! oles! The name of a class should reflect what it is, not the role it plays! Implementation details! Save that for implementation! 6 (Cheng) 3

Eliminate Classes! edundant Irrelevant Vague Attributes heating system Fuel software heat house desired temp user temperature Hot Water heat flow home range Operations oles Implementation None None None Fuel Valve Water Pump furnace thermostat operator on-off switch Burner room Controller Home Heating System Temp Sensor Water Valve Control Panel 7 Classes After Elimination! Fuel Valve Burner Water Pump oom Home Heating System Thermostat Furnace Temp Sensor Water Valve Operator on-off switch Controller Control Panel 8 (Cheng) 4

Prepare Data Dictionary! Water Tank! The storage tank containing the water that circulates in the system.! Pump-1! The pump pumping water from the Water Tank to the radiators in the rooms! 9 Not much information from the prose requirements! A lot of information from the system design! Possible Associations! A room consists of a thermometer and a radiator! A radiator consists of a valve and a radiator element! The home heating system consists of a furnace, rooms, a water pump, a control panel, and a controller! The furnace consists of a fuel pump and a burner! The control panel consists of an on-off switch and a thermostat! The controller controls the fuel pump! The controller controls the burner! The controller controls the water pump! The controller monitors the temperature in each room! The controller opens and closes the valves in the rooms! The operator sets the desired temperature! The operator turns the system on and off! The controller gets notified of the new desired temperature! 10 (Cheng) 5

The Home Heating System! Water Pump Water Valve Hot Water Burner Controller Home Fuel Valve 90 80 Off Fuel 70 60 50 On Control Panel Temp Sensor 11 Object Model! Home Heating System Control Panel Furnace Water Pump uns On-Off Switch Thermostat Burner Fuel Valve Pushes Adjusts 1..* oom 1..* Ignites Opens/Closes Notifies Operator Water Valve Temp Sensor Monitor Controller 12 (Cheng) 6

Object Model - Modified! Home Heating System Control Panel Furnace Water Pump uns On-Off Switch Thermostat Burner Fuel Valve Pushes Adjusts 1..* oom 1..* Ignites Opens/Closes Notifies Operator Water Valve 1..* Temp Sensor Heats Monitor Controller 13 Attributes! Thermostat desired-temp On-Off switch setting Temp Sensor temperature 14 (Cheng) 7

OO Model Modified Again! Home Heating System Control Panel Furnace Water Pump uns On-Off Switch Thermostat setting desired-temp Notifies Pushes Adjusts Operator 1..* oom Water Valve Burner 1..* 1..* Temp Sensor temperature Fuel Valve Opens/Closes Ignites Monitor Heats Controller 15 Iterate the Model! Keep on doing this until you, your customer, and your engineers are happy with the model! Iterate 16 (Cheng) 8

Operation vs Method!!! Operation: specifies object behavior! Service: represented by set of operns.! Message: object requests execution of an opern. from another object by sending it mesg.! Method: mesg is matched up with method defined by the class to which the receiving object belongs (or any of its superclasses)! Operations of class are public services offered by class.! Methods of its classes are the implementations of these operations.! 17 OO Using UML: Dynamic Models! Defining how the objects behave! 18 (Cheng) 9

Overview! The object model describes the structure of the system (objects, attributes, and operations)! The dynamic model describes how the objects change state (how the attributes change) and in which order the state changes can take place! Several models used to find the appropriate dynamic behavior! Interaction diagrams! Activity diagrams! State Diagrams! Uses finite state machines and expresses the changes in terms of events and states! 19 Interaction Diagrams! 20 (Cheng) 10

We Will Cover! Why interaction diagrams?! Sequence diagrams! Capturing use-cases! Dealing with concurrency! Collaboration diagrams! When to use what! When to use interaction diagrams! 21 Different Types of Interaction Diagrams! An Interaction Diagram typically captures a usecase! A sequence of user interactions! Sequence diagrams! Highlight the sequencing of the interactions between objects! Collaboration diagrams! Highlight the structure of the components (objects) involved in the interaction! 22 (Cheng) 11

Home Heating Use-Case! Use case: Power Up Actors: Home Owner (initiator) Type: Primary and essential Description: The Home Owner turns the power on. Each room is temperature checked. If a room is below the the desired temperature the valve for the room is opened, the water pump started, the fuel valve opened, and the burner ignited. If the temperature in all rooms is above the desired temperature, no actions are taken. Cross ef.: equirements XX, YY, and ZZ Use-Cases: None 23 Sequence Diagrams! Use * to A Home denote Owner: t h e O n - O f f S w i t c h: t h e C o n t r o l e r: a o o m: iteration t h e W a t e r P u m p: HomeOwner OnOffSwitch Controller oom WaterPump Use the left column to offer comments about the messages S y s t e m O n p o w e r O n ( ) * [ f o r a l l r o o m s ] t e m p S t a t u s : = c h e c k T e m p ( ) Synchronous message [ t e m p S t a t u s = = l o w ] p u m p O n ( ) esponse to synchronous message [ t e m p S t a t u s = = l o w ] o p e n V a l v e ( ) [ t e m p S t a t u s = = l o w ] s t a r t B u r n e r ( ) Guard for message 24 (Cheng) 12

Example from Fowler! An Entry Window: Window An Order: Order An Order: Order A Stock Item: StockItem p r e p a r e ( ) * [ f o r a l l o r d e r l i n e s ] p r e p a r e ( ) h a s S t o c k : = c h e c k ( ) [ h a s S t o c k ] r e m o v e ( ) n e e d s e o r d e r : = n e e d s T o e o r d e r ( ) [ n e e d s e o r d e r ] n e w [ h a s S t o c k ] n e w A eorder Item: eorderitem A Delivery Item: DeliveryItem 25 Concurrency! n e w a T r a n s a c t i o n n e w a T r a n s a c t i o n C o o r d i n a t o r n e w a f i r s t T r a n s a c t i o n C h e c k e r n e w o k a s e c o n d T r a n s a c t i o n C h e c k e r a l l D o n e? o k a l l V a l i d a l l D o n e? 26 (Cheng) 13

Another Example! a H o m e O w n e r t h e O n - O f f S w i t c h t h e C o n t r o l l e r t h e W a t e r P u m p S y s t e m O n p o w e r O n ( ) * [ f o r e a c h r o o m i n h o u s e ] n e w a o o m c h e c k T e m p ( ) [ t e m p L o w ] p u m p O n ( ) [ t e m p L o w ] o p e n V a l v e ( ) [ t e m p L o w ] s t a r t B u r n e r ( ) t e m p L o w 27 Comment the Diagram! W h e n t h e o w n e r t u r n s t h e s y s t e m o n a H o m e O w n e r t h e O n - O f f S w i t c h t h e C o n t r o l l e r t h e W a t e r P u m p t h e o n s w i t c h n o t i f i e s t h e c o n t r o l l e r S y s t e m O n p o w e r O n ( ) T h e c o n t r o l l e r c r e a t e s a r o o m o b j e c t f o r e a c h r o o m i n t h e b u i l d i n g T h e r o o m s s a m p l e t h e t e m p e r a t u r e i n t h e t o o m e v e r y 5 s. W h e n a l o w t e m p i s d e t e c t e d t h e r o o m n o t i f i e s t h e c o n t r o l l e r. * [ f o r e a c h r o o m i n h o u s e ] n e w [ t e m p L o w ] p u m p O n ( ) [ t e m p L o w ] o p e n V a l v e ( ) [ t e m p L o w ] s t a r t B u r n e r ( ) t e m p L o w a o o m c h e c k T e m p ( ) M H 28 (Cheng) 14

Collaboration Diagrams! :Order Entry Window 1 : prepare() :Order 2 : *[for all order lines]: prepare() 3 : hasstock := check() 5 : needseorder := needstoeorder() 7 : [hasstock] :new Winter line : Order Line 4 : [hasstock]: remove() Winter stock : Stock Item 6 : [needseorder]: new :Delivery Item a eorder Item MH 29 Conditional Behavior! Something you will encounter trying to capture complex use-cases! The user does something. If this something is X do this If this something is Y do something else If this something is Z! Split the diagram into several! Split the use-case also! Use the conditional message! Could become messy! emember, clarity is the goal!! 30 (Cheng) 15

Comparison! Both diagrams capture the same information! People just have different preferences! We prefer sequence diagrams! They clearly highlight the order of things! Invaluable when reasoning about multi-tasking! Others like collaboration diagrams! Shows the static structure! Very useful when organizing classes into packages! We get the structure from the Class Diagrams! 31 When to Use Interaction Diagrams! When you want to clarify and explore single use-cases involving several objects! Quickly becomes unruly if you do not watch it! If you are interested in one object over many use-cases -- state transition diagrams! If you are interested in many objects over many use cases -- activity diagrams! 32 (Cheng) 16

State Diagrams! 33 We Will Cover! State Machines! An alternate way of capturing scenarios! Large classes of scenarios! Syntax and Semantics! When to use state machines! 34 (Cheng) 17

Events, Conditions, and States! Event: something that happens at a point in time! Operator presses self-test button! The alarm goes off! Condition: something that has a duration! The fuel level is high! The alarm is on! State : an abstraction of the attributes and links of an object (or entire system)! The controller is in the state self-test after the self-test button has been pressed and the reset-button has not yet been pressed! The tank is in the state too-low when the fuel level has been below level-low for alarm-threshold seconds! 35 Making a Phone Call Scenario! To make a call, the caller lifts receiver. The caller gets a dial dial tone and the caller dials digit (x). The dial tone ends. The caller completes dialing the number. The callee phone begins ringing at the same time a ringing begins in caller phone. When the callee answers the called phone stops ringing and ringing ends in caller phone. The phones are now connected. The caller hangs up and the phones are disconnected. The callee hangs up.! 36 (Cheng) 18

Partial Class Diagram! Line 1 Connected by 1 Caller Phone 1 Connected by 1 Callee 37 Event Trace! Caller Line Callee caller lifts receiver dial tone begins dials digit (4) dial tone ends dials digit (2) dials digit (3) dials digit (4) dials digit (5) ringing tone phone rings callee answers tone stops ringing stops phones connected phones connected caller hangs up phones disconnected phones disconnected callee hangs up 38 (Cheng) 19

State Diagram for Scenario! on-hook Idle off-hook Dial tone digit(x) digit(x) Dialing valid-number inging called-phone-answers Connected called-phone-hangs-up Disconnected 39 Scenario 2! Caller Line Callee caller lifts receiver dial tone begins dials digit (4) dial tone ends dials digit (2) dials digit (3) dials digit (4) dials digit (5) busy tone caller hangs up 40 (Cheng) 20

Modified State Machine! on-hook Idle off-hook Busy tone Dial tone digit(x) number-busy routed inging digit(x) Dialing valid-number Connecting called-phone-answers Connected called-phone-hangs-up Disconnected 41 Conditions! Sometimes the state transitions are conditional! digit(x) Dialing digit(x) on-hook digit(x) [x = 8] Busy tone Dial tone (external) Idle off-hook Dial tone valid-number number-busy inging routed digit(x) [x!= 8] Dialing Connecting digit(x) valid-number 42 (Cheng) 21

Operations (AKA Actions)! Idle Actions are performed when a transition is taken or performed while in a state! Actions are terminated when leaving the state! on-hook on-hook on-hook Busy tone do/ busy tone on-hook on-hook on-hook / disconnect line on-hook off-hook Dial tone digit(x) do/ sound dial tone digit(x) Dialing number-busy valid-number Connecting routed do/ find connection inging do/ ring bell called-phone-answers / connect line Connected called-phone-hangs-up / disconnect line Disconnected 43 Hierarchical State Machines! Group states with similar characteristics! Enables information hiding! Simplifies the diagrams! Idle Dial tone off-hook do/ sound dial tone dial(x) [x is a digit] Make Call Establish call dial(x) Dialing valid-number number-busy on-hook Connecting do/ find connection Busy tone do/ busy tone routed inging do/ ring bell on-hook dial(x) [x = *] Voice Mail on-hook / disconnect line on-hook Connected called-phone-answers / connect line called-phone-hangs-up / disconnect line Disconnected 44 (Cheng) 22

Information Hiding! on-hook on-hook / disconnect line on-hook Idle off-hook dial(x) [x is a digit] Make Call Establish call Connected Dial tone do/ sound dial tone called-phone-answers / connect line called-phone-hangs-up / disconnect line Disconnected on-hook dial(x) [x = *] Voice Mail Establish call number-busy Busy tone do/ busy tone Dialing valid-number Connecting do/ find connection routed inging do/ ring bell dial(x) 45 Concurrency! Some states represent several concurrent concepts! Concurrency is supported by the state machines! Concurrent state machines are separated by dashed lines! Alarms Disabled out-of-bounds-event Alarms Enabled Visual Alarm reset On Off visual-on Aural Alarm reset On Off aural-on 47 (Cheng) 23

State Machines - Summary! Events! instances in time! Conditions! conditions over time! States! abstraction of the attributes and associations! Transitions! Takes the state machine from one state to the next! Triggered by events! Guarded by conditions! Cause actions to happen! Internal actions! something performed in a state! Hierarchies! allows abstraction and information hiding! Parallelism! models concurrent concepts! 48 When to use State Machines! When you want to describe the behavior of one object for all (or at least many) scenarios that affect that object! Not good at showing the interaction between objects! Use interaction diagrams or activity diagrams! Do not use them for all classes! Some methods prescribe this! Very time consuming and questionable benefit! 49 (Cheng) 24

Coming up with the State Diagrams! 50 Modeling Approach! Prepare scenarios! Work with the customer! Start with normal scenarios! Add abnormal scenarios! Identify events (often messages)! Group into event classes! Draw some sequence diagrams! Find objects with complex functionality you want to understand better! Build a state diagram for the complex classes! 51 (Cheng) 25

Scenario-1! Every 5s Temp Low Every 5s Temp Normal oom request-temp(x) respond-temp(x) open-valve() request-temp(x) respond-temp(x) close-valve() Controller Fuel Valve fuel-open() burner-on() burner-off() pump-on() pump-off() Burner Water Pump fuel-close() 52 Scenario-2! Every 5s Desired temp change Every 5s Temp Low Every 5s Temp Normal Control Panel desired-temp() oom Controller request-temp(x) respond-temp(x) request-temp(x) respond-temp(x) open-valve() request-temp() respond-temp() close-valve() Fuel Valve fuel-open() burner-on() fuel-close() burner-off() pump-on() pump-off() Burner Water Pump 53 (Cheng) 26

Dynamic Model! Water Pump pump-on On Off pump-off Fuel Valve fuel-open Open Closed fuel-close Burner On burner-on burner-off Off 54 More Dynamic Model! Water-Valve open-valve/ pump-on Valve close-valve/ pump-off oom Temp-Sensor request-temp Idle Processing equest temp-report(x)/ respond-temp(x) 55 (Cheng) 27

Even More Dynamic Model! Control Panel Controller respond-temp(x)[x>desired-temp+2]/stop-heating timeout(5s)/ request-temp Temp-Low Temp-Normal timeout(5s)/ request-temp respond-temp(x)[x<desired-temp-2]/start-heating Home Heating System timeout(1s)/ open-valve All-unning stop-heating/ burner-off,pump-off timeout(1s)/burner-on Burner-On Fuel-Open Water-Off Fuel-Off timeout(1s)/fuel-close start-heating/fuel-open All-Off timeout(1s)/close-valve 56 Identify Key Operations! Operations from the object model! Accessing and setting attributes and associations (often not shown)! Operations from events! All events represent some operation! Operations from actions and activities! Actions and activities represent some processing activity within some object! Operations from functions! Each function typically represent one or more operations! Shopping list operations! Inherent operations (what should be there)! 57 (Cheng) 28

OO Model Modified Again! Home Heating System start-heating() stop-heating() Control Panel Furnace Water Pump uns operating() target-temp() pump-on() pump-off() Notifies On-Off Switch setting Pushes Operator Adjusts Thermostat desired-temp 1..* Water Valve oom open-water() close-water() open-valve() close-valve() 1..* temp-report() 1..* Burner burner-on() burner-off() Temp Sensor temperature request-temp() respond-temp() Ignites Fuel Valve fuel-open() fuel-close() Opens/Closes Heats Monitor Controller 58 Iterate the Model! Keep on doing this until you, your customer, and your engineers are happy with the model! Iterate 60 (Cheng) 29

Activity Diagrams! 61 We Will Cover! History of activity diagrams in UML! A highly personal perspective! Activity diagrams! Swimlanes! When to use activity diagrams! When not to! 62 (Cheng) 30

Activity Diagrams! Shows how activities are connected together! Shows the order of processing! Captures parallelism! Mechanisms to express! Processing! Synchronization! Conditional selection of processing! A glorified flowchart! 63 Why Activity Diagrams! Very good question! Not part of any previous (UML related) method! Introduced to sell products! Suitable for modeling of business activities! UML and OO is becoming more prevalent in business applications! Object frameworks are making an inroad! Stay within one development approach and notation! Generally a flowchart and I do not really see the need in OO modeling! Probably because I do not do business systems! 64 (Cheng) 31

Coffee Example! F i n d B e v e r a g e [ n o c o f f e e ] D e c i s i o n [ n o c o k e ] [ f o u n d c o f f e e ] [ f o u n d c o k e ] P u t C o f f e e i n F i l t e r A d d W a t e r t o e s e r v o i r G e t C u p s G e t C a n o f C o k e P u t F i l t e r i n M a c h i n e T u r n O n M a c h i n e ^ c o f f e P o t. T u r n O n B r e w C o f f e e D r i n k B e v e r a g e P o u r C o f f e e M H 65 HACS Use-Cases! Use case: Distribute Assignments Actors: Instructor (initiator), Student Type: Primary and essential Description: The Instructor completes an assignment and submits it to the system. The instructor will also submit the delivery date, due date, and the class the assignment is assigned for. The system will at the due date mail the assignment to the student. Cross ef.: equirements XX, YY, and ZZ Use-Cases: Configure HACS must be done before any user (Instructor or Student) can use HACS 66 (Cheng) 32

Activity Diagrams for Use Cases! W r i t e A s s i g n m e n t [ s u b m i s s i o n t i m e ] W r i t e S o l u t i o n S u b m i t A s s i g n m e n t M a i l A s s i g n m e n t S o l v e A s s i g n m e n t S u b m i t S o l u t i o n S u b m i t S o l v e d A s s i g n m e n t G r a d e A s s i g n m e n t M a i l S o l u t i o n e v i e w S o l u t i o n H i t t h e P u b 67 Swimlanes (Who Does What?)! I n s t r u c t o r H A C S S t u d e n t W r i t e A s s i g n m e n t [ s u b m i s s i o n t i m e ] W r i t e S o l u t i o n S u b m i t A s s i g n m e n t M a i l A s s i g n m e n t S o l v e A s s i g n m e n t S u b m i t S o l u t i o n S u b m i t S o l v e d A s s i g n m e n t G r a d e A s s i g n m e n t M a i l S o l u t i o n e v i e w S o l u t i o n H i t t h e P u b 68 (Cheng) 33

Problems with Activity Diagrams! They are glorified flowcharts! Very easy to make a traditional data-flow oriented design! Switching to the OO paradigm is hard enough as it is! Extensive use of activity charts can make this shift even harder! However...! Very powerful when you know how to use them correctly! 69 When to Use Activity Diagrams! Not clear how useful in OO modeling! Particularly when modeling control systems! Useful when! Analyzing a use case (or collection of use cases)! Understanding workflow in an organization! Working with multi-threaded applications! For instance, process control applications! Do not use activity diagrams! To figure out how objects collaborate! See how objects behave over time! 70 (Cheng) 34