The Unified Process Object Interaction Modeling and Design Class Diagram 中国科学技术大学软件学院 孟宁 2012年10月.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software processes 2.
Advertisements

Objectives Detailed Object-Oriented Requirements Definitions
Introduction To System Analysis and Design
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
The Unified Software Development Process - Workflows Ivar Jacobson, Grady Booch, James Rumbaugh Addison Wesley, 1999.
1 Lecture 2: Elaboration Tasks and Domain Modeling.
1 SWE Introduction to Software Engineering Lecture 5.
Software Engineering CSE470: Requirements Analysis 1 Requirements Analysis Defining the WHAT.
Introduction to Software Engineering Dr. Basem Alkazemi
Deriving a Design Class Diagram Yonglei Tao 1. Responsibilities  Doing  do something itself  initiate action in other objects  control and coordinate.
Object Interaction Modeling
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Object-Oriented Analysis and Design
Introduction To System Analysis and design
The Design Discipline.
CIS 321—IS Analysis & Design
Use Cases Yonglei Tao.
Domain Modeling 中国科学技术大学软件学院 孟宁 2012 年 10 月 Domain Modeling ♦What: A process performed by the development teams to acquire domain knowledge. ♦Why: –Because.
Introduction to Sequence Diagrams
Chapter 10: Applying Responsibility Assignment Patterns
Chapter 8: Actor-System Interaction Modeling
Use Case Modeling 中国科学技术大学软件学院 孟宁 2011年9月.
4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements.
More on “The Huddersfield Method” A lightweight, pattern-driven method based on SSM, Domain Driven Design and Naked Objects.
Introduction To System Analysis and Design
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Key Takeaway Points A use case is a business process; it begins with an actor, ends with the actor, and accomplishes a business task for the actor. Use.
Approaching a Problem Where do we start? How do we proceed?
Chapter 18: Implementation Considerations
Systems Analysis and Design in a Changing World, 3rd Edition
Notes of Rational Related cyt. 2 Outline 3 Capturing business requirements using use cases Practical principles  Find the right boundaries for your.
Review of Software Process Models Review Class 1 Software Process Models CEN 4021 Class 2 – 01/12.
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
The Unified Process & Domain Modeling 中国科学技术大学软件学院 孟宁 2011 年 10 月.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
1 Modeling System Requirements with Use Cases. 2 Why Do We Need Use Cases? Primary challenge in a system design process –ability to elicit correct and.
1 CMPT 275 High Level Design Phase Modularization.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Chapters 10, 11 SSD (Revision) SD DCD Exam Object-Oriented Design.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Chapter 3: Introducing the UML
UML - Development Process 1 Software Development Process Using UML.
Capturing Requirements. Questions to Ask about Requirements 1)Are the requirements correct? 2)Consistent? 3)Unambiguous? 4)Complete? 5)Feasible? 6)Relevant?
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Dillon: CSE470: ANALYSIS1 Requirements l Specify functionality »model objects and resources »model behavior l Specify data interfaces »type, quantity,
1 Process activities. 2 Software specification Software design and implementation Software validation Software evolution.
Use Case Diagram Example
Chapter3:Software Processes
Software Process Activities.
Chapter 16 UML Class Diagrams.
Introduction to Unified Modeling Language (UML)
UML: Unified modeling language
Object Oriented Analysis and Design
Introduction to Unified Modeling Language (UML)
CIS 375 Bruce R. Maxim UM-Dearborn
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Copyright 2007 Oxford Consulting, Ltd
Engineering Quality Software
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 6: Architectural Design
Chapter 9: Object Interaction Modeling
Chapter 11: Deriving a Design Class Diagram
Chapter 17. Applying Patterns to Design a Persistence Framework
Chapter 18: Implementation Considerations
Chapter 8: Actor-System Interaction Modeling
Presentation transcript:

The Unified Process Object Interaction Modeling and Design Class Diagram 中国科学技术大学软件学院 孟宁 2012年10月

The Unified Process Time The waterfall process The unified process Requirements Test Design Code Deploy TIME Increment 1 Increment 2 Increment 3 time The unified process Requirements Test Design Code Deploy Time The waterfall process

The Agile Unified Process Before the iterations, there is a "plan and elaborate" phase motivation, business needs, alternatives requirements elicitation and specification feasibility study use cases and use case diagrams requirements and use cases traceability matrix draft conceptual model schedule, resources, budget

Steps of the Unified Process 1) Identifying requirements 2) Deriving use cases to satisfy the requirements 3) Allocating use cases to increments 4) Carrying out each increment

Carrying out each increment 4) Carry out each increment 4.1) Use case modeling 4.2) Domain modeling 4.3) Interaction modeling 4.4) Derive design class diagram 4.5) Implementation and deployment

Steps of the Agile Unified Method domain knowledge Requirements Engineering requirements requirements Use Case Modeling Domain Modeling abstract, high level & expanded use cases, use case diagrams, UI prototypes domain model Object Interaction Modeling & Design sequence diagrams Design Class Diagram data flow DCD & implementation order control flow Implementation

The Unified Process Use case driven Architecture centric each iteration is driven by the use cases allocated to the iteration Architecture centric “a system's architecture is used as a primary artifact for conceptualizing, constructing, managing, and evolving the system under development." --- Grady Booch Incremental Iterative

Object Interaction Modeling It specifies how objects interact with each other to carry out the background processing of a business process. Object interaction modeling is aided by the specification of scenarios and a scenario table. A scenario is an informal, step-by-step description of object interaction. A scenario table organizes the interaction into a five column table. It facilitates the translation into a sequence diagram.

Steps for Interaction Modeling For each expanded use case do the following: Step 1. Identify and mark nontrivial steps in the right column of the expanded use case. A nontrivial step is one that requires background processing that goes beyond the presentation layer (i.e., the Graphical User Interface or GUI). Step 2. For each nontrivial step, describe a scenario, i.e., how objects interact to carry out the step, beginning with the step on the left column of the expanded use case. Step 3. If desired, convert the scenario into a scenario table. Step 4. Convert the scenarios/scenario table into a sequence diagram.

Scenarios Each sentence of the scenario is a declarative sentence consisting of a subject, an action of the subject, an object that is acted upon, and possibly other objects required by the action. The sentences are arranged in a scenario table to facilitate scenario description and translation into sequence diagrams.

Example * nontrivial step

reducing the number of steps. Scenario Description Could be simplified, e.g., reducing the number of steps.

reducing the number of steps. Could be simplified, e.g., reducing the number of steps.

Guidelines for Scenario Construction Keep it simple and stupid --- leave details to coding. Specify the normal scenario first (i.e., assume everything will go as expected) Augment the normal scenario with alternative flows if needed Leave exception handling to the code It is sometimes desirable to construct a prototype for the normal scenarios to validate the design idea

From Scenario Table to Sequence Diagram Actor :object acted upon action + other objects/data object acted upon for each line of the scenario table: Case 1: subject is an Actor Example: Patron card scanner: <<slide card>>

From Scenario Table to Sequence Diagram : Subject :object acted upon action performing action + other objects/data Case 2: subject is an object Example cards canner: device control: action performing send pid

From Scenario Table to Sequence Diagram

From Scenario Table to Sequence Diagram

Difference of Analysis and Design application problem-oriented modeling application domain describes what the world is project-oriented decisions should allow multiple design alternatives Design software solution-oriented modeling the software system prescribes a software solution system-oriented decisions usually reduces implementation choices

Modeling a Manual Library System Patron presents id card to librarian. These are analysis sequence diagrams that model an existing system. :Librarian Patron <<id card>> Librarian pulls out patron’s folder using id number. :Librain Patron <<uid, pass-word>> :PatronFolders get folder using patron id patron folder

Analysis/Informal Sequence Diagram info exchange b/t actor and object :LoginGui Patron <<uid, password>> an object of LoginGui class the object is processing the request. Patron submits uid and password to LoginGui. :LoginGui Patron <<uid, pass-word>> :LoginController LoginGui object verifies w/ LoginController object <<msg>> LoginGui calls LoginController to verify the login. The controller returns a msg indicating result of verification. LoginGui shows msg to Patron.

From Analysis to Design :LoginGui Patron <<uid, pass-word>> :LoginController LoginGui object verifies w/ LoginController <<msg>> LoginGui calls LoginController to verify the login. The controller returns a msg indicating result of verification. LoginGui shows msg to Patron. :LoginGui Patron <<uid, pass-word>> :LoginController msg := verify (uid:String, password: Password) : String <<msg>> function call parameter & type return type return value

Sequence Diagram: Flow of Control :LoginGui :LoginController 1 (1) patron submits uid and password to LoginGui object 2 (2) LoginGui object calls the verify function of a LoginController object. The called function returns msg of type String. <<uid, pass-word>> msg := verify (uid:String, password: Password) : String <<msg>> 3 (3) The LoginGui object shows msg to patron. Patron

An Analysis Sequence Diagram collection real world object within the library system :Patron Folder f:Patron Folder :Librarian book:Book id card, book get patron folder w/id outside library system patron folder f patron [patron folder not found] error msg, id card [patron folder found] get book card book card [patron folder found] insert book card into patron folder [patron folder found] return patron folder [patron folder found] id card, book This an analysis sequence diagram models the current, manual operation, little design decision is made.

A Design Sequence Diagram :Checkout GUI :DBMgr l:Loan d:Document <<uid,call# list>> u:= getUser(uid): User Patron <<msg>> [u!=null] process(callNumList) Loop (for each cn in callNumList) loop d:=get Document(cn): Document [d!=null]a:=isAvailable():boolean conditional call [a]create(u,d) [a]saveLoan(l) [a]setAvailable(false) [a]save- Document(d)

Deriving Design Class Diagram Design class diagram (DCD) is a structural diagram. It shows the classes, their attributes and operations, and relationships between the classes. It may also show the design patterns used. It is used as a basis for implementation, testing, and maintenance. It should contain only classes appear in the sequence diagrams, and a few classes from the domain model.

Deriving Design Class Diagram It is derived from the domain model (DM) and the sequence diagrams: the domain model provides the attributes and some relationships the sequence diagrams determines the classes and methods, and provides dependence relationships DCD may contain design classes like controller, command, GUI classes. Domain model only contains application objects (classes). DCD must be carefully specified. DM is more liberal.

Steps for Deriving DCD 1) Identify all classes used in each of the sequence diagrams and put them down in the DCD: classes of objects that send or receive messages classes of objects that are passed as parameters or return types/values

Identify Classes Used in Sequence Diagrams <<singleton>> classes used. :Checkout GUI <<uid, cnList>> :DBMgr u:=get User(uid):User b:=get Document(cn) l:Loan [a]create(u,d) [a]save(l) d:Document [a]setAvailable(false) [a]save(d) Controller msg:=check- out(uid, cnList) [u!=null] process(cnList) a:=isAvailable() <<msg>> Loop (for each cn in cnList) Tip: Identify objects that send or receive messages, passed as parameters or return type.

Classes Identified CheckoutGUI User CheckoutController DBMgr Loan Document

Steps for Deriving DCD 2) Identify methods belonging to each class and fill them in the DCD: methods are identified by looking for messages that label an incoming edge of the object the sequence diagram may also provide detailed information about the parameters, their types, and return types

Identify Methods <<uid, cnList>> :DBMgr u:=get :Checkout GUI <<uid, cnList>> :DBMgr u:=get User(uid):User d:=get Document(cn) l:Loan [a]create(u,d) [a]save(l) d:Document [a]setAvailable(false) [a]save(d) Controller msg:=check- out(uid, cnList) [u!=null] process(cnList) a:=isAvailable() <<msg>> Loop (for each cn in cnList) methods of CheckoutController methods of Document

Fill In Identified Methods CheckoutGUI User CheckoutController checkout(uid,cnList) process(cn:String[]) Loan <<singleton>> Document DBMgr getUser(uid) getDocument(callNo) saveLoan(loan) saveDocument(book) create(u:User, d:Document) isAvailable() : boolean setAvailable(a:boolean)

Steps for Deriving DCD 3) Identify and fill in attributes from sequence diagrams and domain model: attributes are not objects and have only scalar types attributes may be used to get objects attributes may be identified from getX() and setX(...) methods needed attributes may also be found in the domain model

Identify Attributes :Checkout GUI <<uid, cnList>> :DBMgr u:=get User(uid):User b:=get Document(cn) l:Loan [a]create(u,d) [a]save(l) d:Document [a]setAvailable(false) [a]save(d) Controller msg:=check- out(uid, cnList) [u!=null] process(cnList) a:=isAvailable() <<msg>> Loop (for each cn in cnList) attribute of User attributes of Document attribute value

Fill In Attributes CheckoutGUI User uid : String display(msg:String) CheckoutController from domain model checkout(uid,cnList) process(cn:String) Loan <<singleton>> dueDate : Date Document DBMgr callNum : String isAvailable : boolean create(u:User, d:Document) getUser(uid) getDocument(callNo) saveLoan(loan) saveDocument(book) isAvailable() : boolean setAvailable(a:boolean)

Steps for Deriving DCD 4) Identify and fill in relationships from sequence diagram and domain model: arrows from one object to another is a call and hence it is a dependence relationship objects passed as parameters or return type/value is an association or uses relationship two or more objects passed to a constructor may indicate association and an association class the domain model may contain useful relationships as well

Identify Relationships :Checkout GUI <<uid, cnList>> :DBMgr u:=get User(uid):User b:=get Document(cn) l:Loan [a]create(u,d) [a]save(l) d:Document [a]setAvailable(false) [a]save(d) Controller msg:=check- out(uid, cnList) [u!=null] process(cnList) a:=isAvailable() <<msg>> Loop (for each cn in cnList) CheckoutController and DBMgr uses User. call relationship association w/ an association class.

Fill In Relationships The creator CheckoutGUI pattern CheckoutGUI The dashed arrow lines denote uses or dependence relationships. display(msg:String) <<create>> CheckoutController checkout(uid,cnList) process(cn:String) User uid : String Loan dueDate : Date create(u:User, d:Document) <<singleton>> Document DBMgr callNum : String available : boolean getUser(uid) getDocument(callNo) saveLoan(loan) saveDocument(book) isAvailable() : boolean setAvailable(a:boolean)

From Sequence Diagram to Implementation :Checkout GUI :DBMgr l:Loan d:Document public class CheckoutGUI { DBMgr dbm=new DBMgr (); public void process(String[] cnList) { for(int i=0; i<cnList.length; i++) { Document d=dbm.getDocument(cnList[i]); if (d.isAvailable()) { Loan l=new Loan(u, d); dbm.saveLoan(l); d.setAvailable(false); dbm.saveDocument(d); } <<uid,cnList>> u:= getUser(uid): User Patron <<msg>> [u!=null] process(cnList) Loop (for each cn in cnList) d:=get Document(cn): Document a:=isAvailable():boolean [a]create(u,d) [a]saveLoan(l) [a]setAvailable(false) [a]save- Document(d)

谢谢大家! References Dr. David Kung University of Texas Arlington May 2010