Download presentation
Presentation is loading. Please wait.
Published byMorgan Gordon Modified over 9 years ago
1
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Use-Case Design
2
Object Oriented Analysis and Design 2 Use-Case Design in Context [Early Elaboration Iteration] [Inception Iteration (Optional)] Define a Candidate Architecture Perform Architectural Synthesis Analyze Behavior Refine the Architecture Define Components Design the Database (Optional) Use-Case Design Designer
3
Object Oriented Analysis and Design 3 Use-Case Design Overview Supplementary Specifications Use-Case Design Use-Case Realization (Refined) Design Subsystems and Interfaces Design Classes use-case
4
Object Oriented Analysis and Design 4 Outline Describe interaction among design objects Simplify sequence diagrams using subsystems Describe persistence-related behavior Refine the flow of events description Unify classes and subsystems
5
Object Oriented Analysis and Design 5 Outline Describe interaction among design objects Simplify sequence diagrams using subsystems Describe persistence-related behavior Refine the flow of events description Unify classes and subsystems
6
Object Oriented Analysis and Design 6 Review: Use-Case Realization Class Diagrams Use Case Collaboration Diagrams Use-Case ModelDesign Model Use CaseUse-Case Realization Sequence Diagrams
7
Object Oriented Analysis and Design 7 Analysis ClassesDesign Elements Many-to-Many Mapping Review: From Analysis Classes to Design Elements >
8
Object Oriented Analysis and Design 8 Class Diagrams Use-Case Realization Refinement Identify participating objects Allocate responsibilities among objects Model messages between objects Describe processing resulting from messages Model associated class relationships Sequence Diagrams
9
Object Oriented Analysis and Design 9 Identify each object that participates in the flow of the use case Represent each participating object in a sequence diagram Incrementally incorporate applicable architectural mechanisms Use-Case Realization Refinement Steps
10
Object Oriented Analysis and Design 10 Representing Subsystems on a Sequence Diagram Interfaces Represent any model element that realizes the interface No message should be drawn from the interface Proxy class Represents a specific subsystem Messages can be drawn from the proxy Object AInterfaceObject B 1: Message 1 2: Message 2 Object A Proxy Object B 1: Message 1 2: Message 2 X Invalid messageValid message
11
Object Oriented Analysis and Design 11 Analysis classes are mapped directly to design classes. Analysis ClassesDesign Elements Example: Incorporating Subsystem Interfaces BillingSystem //submit bill() > Billing System > IBillingSystem submitBill(forTuition : Double, forStudent : Student) CourseCatalogSystem //get course offerings() > Course Catalog System > ICourseCatalogSystem getCourseOfferings(forSemester : Semester, forStudent : Student) : CourseOfferingList initialize()
12
Object Oriented Analysis and Design 12 Example: Incorporating Subsystem Interfaces (Before) Analysis class to be replaced with an interface : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student : CourseCatalogSystem Student wishes to create a new schedule 1. // create schedule( ) 1.2. // display course offerings( ) 1.1. // get course offerings( ) 1.1.1. // get course offerings(forSemester) 1.3. // display blank schedule( ) 2. // select 4 primary and 2 alternate offerings( ) 2.1. // create schedule with offerings( ) 2.1.1. // create with offerings( ) A blank schedule is displayed for the students to select offerings 2.1.2. // add schedule(Schedule) At this point, the Submit Schedule subflow is executed A list of the available course offerings for this semester are displayed
13
Object Oriented Analysis and Design 13 Example: Incorporating Subsystem Interfaces (After) : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student : ICourseCatalogSystem Student wishes to create a new schedule 1. // create schedule( ) 1.2. // display course offerings( ) 1.1. // get course offerings( ) 1.1.1. getCourseOfferings(Semester) 1.3. // display blank schedule( ) 2. // select 4 primary and 2 alternate offerings( ) 2.1. // create schedule with offerings( ) 2.1.1. // create with offerings( ) A blank schedule is displayed for the Student to select offerings 2.1.2. // add schedule(Schedule) At this point, the Submit Schedule subflow is executed A list of the available course offerings for this semester are displayed Replaced with subsystem interface
14
Object Oriented Analysis and Design 14 Example: Incorporating Subsystem Interfaces (VOPC) ICourseCatalogSystem getCourseOfferings() initialize() (from External System Interfaces) > RegisterForCoursesForm // submit schedule() // display course offerings() // display schedule() // save schedule() // create schedule() // select 4 primary and 2 alternate offerings() // display blank schedule() (from Registration) > Student. - name - address - studentID : int // addSchedule() // getSchedule() // hasPrerequisites() // passed() (from University Artifacts) > RegistrationController // submit schedule() // save schedule() // create schedule with offerings() // getCourseOfferings() (from Registration) > 0..1 registrant 11 Schedule semester // submit() // save() // any conflicts?() // new() (from University Artifacts) > 0..* 1 0..1 currentSchedule CourseOffering number startTime endTime days // addStudent() // removeStudent() // new() // setData() (from University Artifacts) > 0..* 0..4 primaryCourses 0..* 0..2 alternateCourses 0..* 1 Subsystem interface
15
Object Oriented Analysis and Design 15 Analysis ClassAnalysis Mechanism(s) Student CourseOffering Course RegistrationController Persistency, Security Persistency, Legacy Interface Distribution Incorporating Architectural Mechanisms: Security Analysis-Class-to-Architectural-Mechanism Map from Use-Case Analysis SchedulePersistency, Security Details are in the appendix.
16
Object Oriented Analysis and Design 16 Analysis ClassAnalysis Mechanism(s) Student CourseOffering Course RegistrationController Persistency, Security Persistency, Legacy Interface Distribution Incorporating Architectural Mechanisms: Distribution Analysis-Class-to-Architectural-Mechanism Map from Use-Case Analysis SchedulePersistency, Security
17
Object Oriented Analysis and Design 17 Review: Incorporating RMI: Steps Provide access to RMI support classes (e.g., Remote and Serializable interfaces, Naming Service) Use java.rmi and java.io package in Middleware layer For each class to be distributed: Controllers to be distributed are in Application layer Dependency from Application layer to Middleware layer is needed to access java packages Define interface for class that realizes Remote Have class inherit from UnicastRemoteObject - Done
18
Object Oriented Analysis and Design 18 Have classes for data passed to distributed objects realize the Serializable interface Core data types are in Business Services layer Dependency from Business Services layer to Middleware layer is needed to get access to java.rmi Add the realization relationships Run pre-processor – out of scope Review: Incorporating RMI: Steps (cont.) - Done
19
Object Oriented Analysis and Design 19 Review: Incorporating RMI: Steps (cont.) Have distributed class clients look up the remote objects using the Naming service Most Distributed Class Clients are forms Forms are in Application layer Dependency from Application layer to Middleware layer is needed to get access to java.rmi Add relationship from Distributed Class Clients to Naming Service Create/update interaction diagrams with distribution processing (optional) - Done
20
Object Oriented Analysis and Design 20 Example: Incorporating RMI currentSchedule registrant CourseOfferingList (from University Artifacts) Naming + lookup() (from rmi) RegisterForCoursesForm (from Registration ) > Remote (from rmi) > RegistrationController (from Registration) > Student (from University Artifacts) > UnicastRemoteObject (from server) Serializable (from io) > Schedule (from University Artifacts) > Distributed Class Client Distributed Class Passed Class IRegistrationController + getCurrentSchedule(forStudent : Student, forSemester : Semester) : Schedule + deleteCurrentSchedule() + submitSchedule() + saveSchedule() + getCourseOfferings() : CourseOfferingList (from Registration) > 1 1 0..1 0..n 0..1 1
21
Object Oriented Analysis and Design 21 Example: Incorporating RMI (cont.) > Business Services > Middleware > Application Middleware > Application > Business Services > java.rmi > remote (from java.rmi) Naming (from java.rmi) UnicastRemote Object (from Server) Server > Serializable (from java.io) Java.io Registration Package (from Application) University Artifacts (from Business Services)
22
Object Oriented Analysis and Design 22 Example: Incorporating RMI (cont.) Added to support distribution All calls to the distributed class interface are forwarded to the remote instance. RegisterForCoursesForm : Naming. :IRegistrationController Lookup remote object by specifying it's URL 1: lookup(string) 2: doSomething
23
Object Oriented Analysis and Design 23 Outline Describe interaction among design objects Simplify sequence diagrams using subsystems Describe persistence-related behavior Refine the flow of events description Unify classes and subsystems
24
Object Oriented Analysis and Design 24 Raises the level of abstraction Encapsulating Subsystem Interactions Interactions can be described at several levels Subsystem interactions can be described in their own interaction diagrams
25
Object Oriented Analysis and Design 25 When to Encapsulate Subflows in a Subsystem Encapsulate a Subflow when it: Occurs in multiple use-case realizations Has reuse potential Is complex and easily encapsulated Is responsibility of one person or team Produces a well-defined result Is encapsulated within a single Implementation Model component
26
Object Oriented Analysis and Design 26 InterfaceA op1() > MySubsystem op1() Guidelines: Encapsulating Subsystem Interactions Subsystems should be represented by their interfaces on interaction diagrams Messages to subsystems are modeled as messages to the subsystem interface Messages to subsystems correspond to operations of the subsystem interface Interactions within subsystems are modeled in Subsystem Design > :InterfaceA
27
Object Oriented Analysis and Design 27 Advantages of Encapsulating Subsystem Interactions Use-case realizations: Are less cluttered Can be created before the internal designs of subsystems are created (parallel development) Are more generic and easier to change (Subsystems can be substituted.)
28
Object Oriented Analysis and Design 28 Use subsystem interfaces as synchronization points Parallel Subsystem Development Concentrate on requirements that affect subsystem interfaces Outline required interfaces Model messages that cross subsystem boundaries Draw interaction diagrams in terms of subsystem interfaces for each use case Refine the interfaces needed to provide messages Develop each subsystem in parallel
29
Object Oriented Analysis and Design 29 Outline Describe interaction among design objects Simplify sequence diagrams using subsystems Describe persistence-related behavior Refine the flow of events description Unify classes and subsystems
30
Object Oriented Analysis and Design 30 Outline: Describe Persistence-Related Behavior Describe Persistence-Related Behavior Modeling Transactions Writing Persistent Objects Reading Persistent Objects Deleting Persistent Objects
31
Object Oriented Analysis and Design 31 Modeling Transactions What is a transaction? Atomic operation invocations “All or nothing” Provide consistency Modeling options Textually (scripts) Explicit messages Error conditions Rollback Failure modes May require separate interaction diagrams
32
Object Oriented Analysis and Design 32 Analysis ClassAnalysis Mechanism(s) Student CourseOffering Course RegistrationController Persistency, Security Persistency, Legacy Interface Distribution Incorporating the Architectural Mechanisms: Persistency Analysis-Class-to-Architectural-Mechanism Map from Use-Case Analysis SchedulePersistency, Security Legacy persistency (RDBMS ) is deferred to Subsystem Design. OODBMS Persistency RDBMS Persistency Details in Appendix
33
Object Oriented Analysis and Design 33 Outline Describe interaction among design objects Simplify sequence diagrams using subsystems Describe persistence-related behavior Refine the flow of events description Unify classes and subsystems
34
Object Oriented Analysis and Design 34 Detailed Flow of Events Description Options Annotate the interaction diagrams : Actor1 : ClassA : ClassB 1: Do Something 2: Do Something More Scripts can be used to describe the details surrounding these messages. Notes can include more information about a particular diagram element Script Note
35
Object Oriented Analysis and Design 35 Outline Describe interaction among design objects Simplify sequence diagrams using subsystems Describe persistence-related behavior Refine the flow of events description Unify classes and subsystems
36
Object Oriented Analysis and Design 36 Model element names should describe their function Merge similar model elements Use inheritance to abstract model elements Keep model elements and flows of events consistent Design Model Unification Considerations
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.