The Anatomy of Collaboration Diagrams

43 527 0
The Anatomy of Collaboration Diagrams

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

37 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 37 The Anatomy of Collaboration Diagrams The Anatomy of Collaboration Diagrams :Client :Supplier Client Object Link Supplier Object 1: PerformResponsibility Message 38 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 38 Ví duï: Ví duï: Collaboration Diagram Collaboration Diagram : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student : CourseCatalogSystem 1.2. // display course offerings( ) 1.3. // display blank schedule( ) : Course Catalog 1. // create schedule( ) 2. // select 4 primary and 2 alternate offerings( ) 1.1. // get course offerings( ) 2.1. // create schedule with offerings( ) 2.1.1. // create with offerings( ) 1.1.1. // get course offerings(forSemester) 2.1.2. // add schedule(Schedule) 1.1.1.1. // get course offerings( ) 39 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 39 Ví duï: Ví duï: Collaboration Diagram (cont.) Collaboration Diagram (cont.) : CourseOffering : Student : RegistrationController : Schedule : Student : PrimaryScheduleOfferingInfob 1.1.2.4. // any conflicts?( ) : RegisterForCoursesForm 1. // submit schedule( ) 1.1. // submit schedule( ) 1.1.2. // submit( ) 1.1.1. // save( ) 1.1.2.3. // still open?( ) 1.1.2.5. // add student(Schedule) 1.1.2.1. // is selected?( ) 1.1.2.6. // mark as enrolled in( ) 1.1.2.2. // has pre-requisites(CourseOffering) 40 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 40 One Interaction Diagram Not Good Enough One Interaction Diagram Not Good Enough Basic Flow Alternate Flow 1 Alternate Flow 2 Alternate Flow 3 AF1 AF2 AF3 Alternate Flow 4 Alternate Flow 5 Alternate Flow n 41 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 41 Collaboration Diagrams Vs Sequence Diagrams Collaboration Diagrams Vs Sequence Diagrams z Collaboration Diagrams –Chỉ ra các mối quan hệ bổ sung cho các tương tác –Trực quan hóa tốt hơn các mẫu cộng tác –Trực quan hóa tốt hơn các hiệu ứng tác động lên một đối tượng cụ –Dễ sử dụng hơn trong các v/đ cần g/q tập thể z Sequence Diagrams –Chỉ ra rõ ràng chuỗi các thông điệp –Trực quan hóa tốt hơn toàn bộ luồng sự kiện –Tốt hơn cho các đặc tả real-time và cho các scenario phức tạp 42 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 42 Exercise: Use Exercise: Use - - Case Analysis, Part 1 Case Analysis, Part 1 z Hãy xây dựng: – Use-Case Model, đặc biệt là các use-case flows of events –Các trừu tượng hóa/class then chốt (còn tiếp) 43 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 43 Exercise: Use Exercise: Use - - Case Analysis, Part 1 (cont.) Case Analysis, Part 1 (cont.) z Hãy xác định các thông tin sau cho mộtuse case cụ thể: – Các analysis class, cùng với chúng là: z Brief descriptions z Stereotypes z Responsibilities – Các collaboration cần thiết để cài đặt use case (còn tiếp) 44 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 44 Exercise: Use Exercise: Use - - Case Analysis, Part 1 (cont.) Case Analysis, Part 1 (cont.) z Với một use case cụ thể, hãy thiết lập: – Use-case realization interaction diagram cho tối thiểumột trong các use-case flows of events 45 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 45 Use Use - - Case Analysis Steps Case Analysis Steps z Bổ sung các mô tả của Use-Case z Đ/v mỗi use-case realization – Tìm các Class từ Use-Case Behavior – Phân bổ Use-Case Behavior cho các Class z Đ/v mỗi analysis class tìm được –Mô tả các nhiệm vụ của chúng – Mô tả các Attribute và Association – Lượng giá các Analysis Mechanism z Hợp nhất các Analysis Class z Checkpoints 46 OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 46 Describe Responsibilities Describe Responsibilities z Trách nhiệm (responsibilities) là gì? z Làm thế nào để tìm ra chúng? Interaction Diagram // PerformResponsibility :Client :Supplier Class Diagram Supplier // PerformResponsibility [...]... Schedule // create with offerings() 64 Ví duï: VOPC: Finding Relationships (contd) PrimaryScheduleOfferingInfob grade // is enrolled in?() // mark as enrolled in() Schedule primaryCourses // cancel(theOffering : CourseOffering) // submit() 0 * // any conflicts?() 0 * // create with offerings() 0 4 alternateCourses ScheduleOfferingInfo status // mark as selected()... RegisterForCoursesForm // create schedule () // display course offerings () // display blank schedule // select 4 primary and 2 alternate offerings() 1 1 CourseCatalogSystem 1 0 * // get course offerings(forSemester) 0 1 RegistrationController // get course offerings() // create schedule with offerings 0 1 0 1 1 registrant currentSchedule Student // add... pre-requisites() // get course offerings() // submit schedule() // create schedule with offerings() // get course offerings() Schedule ScheduleOfferingInfo status // create with offerings() // submit() // save() // mark as selected() // mark as cancelled() // is selected?() CourseOffering number : String = "100" startTime : Time endTime : Time days : Enum // add student()... class Student CourseOffering Simple association is a pre-requisite of Schedule Course Reflexive association Association là một quan hệ cấu trúc OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 53 Review: What are Roles? “Nhân vật” mà một class “đóng vai” trong association Professor CourseOffering Instructor Department head Role...Ví duï: View of Participating Classes (VOPC) Class Diagram RegistrationController RegisterForCoursesForm // submit schedule() // display course offerings() // display schedule() // create schedule() // select 4 primary and 2 alternate offerings() // display blank schedule() Student // add schedule() // has pre-requisites() // get course offerings() // submit... PrimaryScheduleOfferingInfo grade // is enrolled in?() // mark as enrolled in() Maintaining Consistency: What to Look For In order of criticality – Redundant responsibilities across classes – Disjoint responsibilities within classes – Class with one responsibility – Class with no responsibilities – Better distribution of behavior – Class that interacts with many other classes OOAD Sử dụng... cancelled() // is selected?() Schedule 0 * CourseOffering 0 * PrimaryScheduleOfferingInfob grade OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 alternateCourses 0 2 // is enrolled in?() // mark as enrolled in() 62 // mark as committed() primaryCourses 0 4 Finding Relationships 1: PerformResponsibility Collaboration Diagram :Client :Supplier Link Client Class Diagram... Course OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 54 Ví duï: Multiple Associations primaryCourses Schedule CourseOffering alternateCourses Schedule add student to remove student from CourseOffering Các Multiple association phải phản ánh multiple roles OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 55 Review: Multiplicity Không... CourseOffering Review: Navigability Khả năng định hướng từ associating class đến target class Hai chiều Một chiều OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 Class1 Class2 Class1 Class2 58 Ví duï: Navigability 1 RegisterForCoursesForm 1 RegistrationController 1-way navigation Schedule 0 4 0 * primaryCourses 0 * 0 2 alternateCourses CourseOffering... CourseOffering Association or Aggregation? Xem xét – Ngữ cảnh, các đặc trưng độc lập của Class2 Class1 Class2 association Class1 aggregation Class2 Khi cảm thấy nghi ngờ hãy dùng association OOAD Sử dụng UML - Phân tích Use-Case Dương Anh Đức 9/2000 61 Association Class Một class “được gắn” vào một association Chứa các thuộc tính của relationship Một thể hiện / 1 link ScheduleOfferingInfo . Phân tích Use-Case Dương Anh Đức 9/2000 37 The Anatomy of Collaboration Diagrams The Anatomy of Collaboration Diagrams :Client :Supplier Client Object Link. Dương Anh Đức 9/2000 41 Collaboration Diagrams Vs Sequence Diagrams Collaboration Diagrams Vs Sequence Diagrams z Collaboration Diagrams –Chỉ ra các mối

Ngày đăng: 06/10/2013, 08:20

Hình ảnh liên quan

z Mô hình hóa một liên hệ ngữ nghĩa giữa các thể hiện (instances) của các class - The Anatomy of Collaboration Diagrams

z.

Mô hình hóa một liên hệ ngữ nghĩa giữa các thể hiện (instances) của các class Xem tại trang 17 của tài liệu.
mô hình hóa một mối quan hệ toàn thể-bộ - The Anatomy of Collaboration Diagrams

m.

ô hình hóa một mối quan hệ toàn thể-bộ Xem tại trang 24 của tài liệu.

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan