PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
5
Các bước thiết kế Use-Case
w Mô tả tương tác giữa các Design Object
w Đơn giản hóa các Interaction Diagram nhờ vào
các Subsystem (optional)
w Mô tác các hành vi liên quan đến tính
Persistence
w Tinh chỉnh mô tả về các Flow of Events
w Hợp nhất các Class và các Subsystem
w Checkpoints
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
6
Nhắc lại: Use-Case Realization
Class Diagrams
Sequence Diagrams
Use Case
Use-Case Model Design Model
Use Case Use-Case Realization
Collaboration Diagrams
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
7
Các bước thiết kế Use-Case
w Mô tả tương tác giữa các Design Object
w Đơn giản hóa các Interaction Diagram nhờ vào
các Subsystem (optional)
w Mô tác các hành vi liên quan đến tính
Persistence
w Tinh chỉnh mô tả về các Flow of Events
w Hợp nhất các Class và các Subsystem
w Checkpoints
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
8
Sequence Diagrams
Class Diagrams
Tinh chỉnh Use-Case Realization
w Xác đònh các object có tham gia vào Use-Case
w Phân công trách nhiệm cho các object
w Mo hình hóa các thông điệp giữa các object
w Mô tả các kết quả xử lý từ các thông điệp
w Mô hình hóa quan hệ giữa các class liên quan
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
9
Các bước tinh chỉnh Use-Case Realization
w Thay thế các class khả dụng bằng các
subsystem interface kết hợp với chúng
w Từng bước tích hợp các cơ chế kiến trúc khả
dụng
w Hiệu chỉnh use-case realization
§ Các Interaction diagram
§ View of participating classes (VOPC) class
diagram(s)
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
10
Tất cả các analysis class khác được ánh xạ thành các design class
BillingSystem
// submit bill()
<<boundary>>
BillingSystem
<<subsystem>>
IBillingSystem
CourseCatalogSystem
// get course offerings()
<<boundary>>
CourseCatalogSystem
<<subsystem>>
ICourseCatalogSystem
Analysis Classes Design Elements
Ví dụ: Tích hợp Subsystem Interfaces
getCourseOfferings(forSemester : Semester) : CourseOfferingList
submitBill(forTuition : Double, forStudent : Student)
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
11
Ví dụ: Trước khi tích hợp SubSystem Interfaces
Phải thay bằng subsystem interface
: Student
: RegisterForCoursesForm : RegistrationController : Schedule : Student: CourseCatalogSystem
Một ds các học phần
có thể đăng ký trong HK
được hiển thò
Student muốn
Tạo mới
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)
Tại vò trí này Submit Schedule subflow được thực hiện
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
12
Ví dụ: Sau khi tích hợp Subsystem Interface
: Student
: RegisterFor
CoursesForm
: Registration
Controller
: Schedule : Student: ICourseCatalog
System
A list of the available
course offerings for this
semester are displayed
Student wishes to
create a new
schedule
1: // create schedule( )
1.2: // display course offerings( )
1.1: // get course offerings( )
2.1.2: // add schedule(Schedule)
1.1.1: getCourseOfferings(Semester)
1.3: // display blank schedule( )
Tại vò trí này Submit Schedule subflow được thực hiện
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
Đã thay vào subsystem interface
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
13
Ví dụ: Tích hợp Subsystem Interfaces (VOPC)
ICourseCatalogSystem
getCourseOfferings()
initialize()
(from External System Interfaces)
<<Interface>>
RegisterForCoursesForm
// submit schedule()
// display course offerings()
// display schedule()
// save schedule()
// create schedule()
// select 4 primary and 2 alternate offerings()
// display blank schedule()
(from Registration)
<<boundary>>
Student.
- name
- address
- studentID : int
// addSchedule()
// getSchedule()
// hasPrerequisites()
// passed()
(from University Artifacts)
<<entity>>
RegistrationController
// submit schedule()
// save schedule()
// create schedule with offerings()
// getCourseOfferings()
(from Registration)
<<control>>
0 1
0 1
registrant
1 1
Schedule
semester
// submit()
// save()
// any conflicts?()
// new()
(from University Artifacts)
<<entity>>
0 *
1
0 1
0 1
currentSchedule
CourseOffering
number
startTime
endTime
days
// addStudent()
// removeStudent()
// new()
// setData()
(from University Artifacts)
<<entity>>
0 *
0 4
primaryCourses
0 *
0 2
alternateCourses
0 *
1
Subsystem interface
PT & TK Hướng đối tượng – Thiết kế kiến trúc
Dương Anh Đức
14
Analysis Class Các cơ chế
Student
CourseOffering
Course
RegistrationController
Persistency, Security
Persistency, Legacy Interface
Persistency, Legacy Interface
Distribution
Tích hợp các cơ chế kiến trúc: Security
w Bảng ánh xạ các Analysis-Class với các cơ chế
kiến trúc có từ bước phân tích Use-Case
Schedule Persistency, Security
Không có nhận xét nào:
Đăng nhận xét