Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD :...

121
โดย อาจารย์ ดร. นัฐพงศ์ ส่งเนียม http://www.siam 2dev.com [email protected] สาขาวิชา วิทยาการคอมพิวเตอร์ คณะวิทยาศาสตร์และเทคโนโลยี มหาวิทยาลัยราชภัฏพระนคร Last Update : 30/01/2561 Lec07 : Use case model แหล่งข ้อมูลเพิ่มเติม : : http://www.lumpaya.com/sdlc01.htm http://www.siam2dev.com [ dr. nattapong songneam]

Transcript of Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD :...

Page 1: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

โดย อาจารย ดร. นฐพงศ สงเนยมhttp://[email protected]

สาขาวชา วทยาการคอมพวเตอรคณะวทยาศาสตรและเทคโนโลย มหาวทยาลยราชภฏพระนคร

Last Update : 30/01/2561

Lec07 : Use case model

แหลงขอมลเพมเตม : : http://www.lumpaya.com/sdlc01.htmhttp://www.siam2dev.com [ dr.

nattapong songneam]

Page 2: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Lecture Outline

1. กระบวนการพฒนาซอฟตแวร (Software Development Process )

ทบทวน

2. ข นตอนการวเคราะหระบบ (System Analysis)

3. การวเคราะหระบบดวย ยสเคส (System Analysis and Use Case )

4. การสราง ยสเคสไดอะแกรม (Use Case Diagram )

5. ตวอยางของ ยเคส (Example Of Use case)

Page 3: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

UP :: โครงสรางกรรมวธ - Lifecycle Phases

เตรยมงาน (Inception) – นยามขอบเขตของโครงการ , ขอบเขตของระบบทจะพฒนา

OOAD : Object-Oriented Analysis and Design 3

Inception Elaboration Construction Transition

time

Unified process แบงการพฒนาออกเปน 4 เฟส (phases) แบงโครงการออกเปน 4 ระยะ

ทารายละเอยด (Elaboration) – วางแผนโครงการ จดทารายละเอยดความตองการ จดสรางสถาปตยกรรมระบบ

จดสราง (Construction) – สรางและทดสอบโปรแกรม

ถายโอน (Transition) – ตดตงถายโอนระบบใหกบผใช

3

Requirement Analysis

Use case จะเรมทาในเฟส น

Requirement specifications

Presenter
Presentation Notes
ในชวง Inception จะเปนการกำหนดขอบเขตของโครงการ ระบวาสงใดทอยในโครงการ สงใดไมอยในโครงการ การกำหนดขอบเขตทำไดโดยการระบถง actors ซงกคอผใชระบบ ระบถงสงทระบบตองกระทำ ทเรยกวา use cases ตามทผใชแตละกลมคาดหวง , we define the scope of the project, what is included, and what is not. We do this by identifying all the actors and use cases, and by drafting the most essential use cases (usually approximately 20 percent of the complete model). A business plan is developed to determine whether resources should be committed to the project. During Elaboration, we focus on two things: getting a good grasp of the requirements (80 percent complete), and establishing an architectural baseline. If we have a good grasp of the requirements and the architecture, we can eliminate a lot of the risks, and we will have a good idea what amount of work remains to be done. We can make detailed cost/resource estimations at the end of Elaboration. During Construction, we build the product in several iterations up to a beta release. During Transition, we transition the product to the end user and focus on end user training, installation, and support. The amount of time spent in each phase varies. For a very complex project with a lot of technical unknowns and unclear requirements, Elaboration may include three to five iterations. For a very simple project, where requirements are known and the architecture is simple, Elaboration may include only a single iteration.
Page 4: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

การเขยนโครงการ (Proposal)

• ชอโครงการ

• ความเปนมาและความสาคญของปญหา

• วตถประสงคของโครงการ

• ขอบเขต

• แผนการดาเนนงาน Gantt Chart

• ประโยชนทคาดวาจะไดรบ

• อภธานศพทเฉพาะ

Page 5: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

The Iterative Approach

OOAD : Object-Oriented Analysis and Design 5

Disciplinesgroup activities

logically

In an iteration,you walk through

all disciplines

5

Presenter
Presentation Notes
This graphic illustrates how phases and iterations (the time dimension) relate to the development activities (the discipline dimension). The relative size of the color area indicates how much of the activity is performed in each phase/iteration. Each iteration involves activities from all disciplines. The relative amount of work related to the disciplines changes between iterations. For instance, during late Construction, the main work is related to Implementation and Test and very little work on Requirements is done. Note that requirements are not necessarily complete by the end of Elaboration. It is acceptable to delay the analysis and design of well-understood portions of the system until Construction because they are low in risk.
Page 6: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ระบบบรหารโรงแรม ABC

Business Model : โมเดลทางธรกจBusiness Rule : กฏเกณฑ/เงอนไขทางธรกจ

โปรแกรม บรหารงานโรงแรม (GENiUS iHotel) เปน โปรแกรมโรงแรม ทออกแบบสาหรบชวยบรหารงาน โรงแรม รสอรท อพารทเมนต แบบรายวน และรายเดอน โดยสวนประกอบหลกๆ ของโปรแกรมจะประกอบไปดวย ขอมลหองพก (Room Information) ระบบการจองหองพก (Reservation) ระบบการเชคอน (Guest Check In) ระบบการเชคเอาท (Guest Check Out) ระบบขอมลผเขาพก (Guest History) ระบบการขายสนคาในหองพก (Mini Bar) ระบบการซอสนคา ระบบสตอกสนคา (Inventory) ระบบแมบาน (House Keeping) ระบบการบารงรกษาหองพก (Room Maintainance) ระบบการปดบญชรอบวน (Night auditor) และ ระบบงานเอกสาร ตางๆ อาทเชน Guest Folio ใบเสรจรบเงน ใบกากบภาษ เปนตน รวมไปทงระบบการรายงานรายวน รายงานแบบสรป และ รายงานเชงวเคราะห เชงลก ใหผบรหาร อาทเชน รายงานประวตผเขาพก รายงานการรบเงนของ Cashier รายงานการเขาพก รายงานสรปยอดหองพกคงเหลอ (Room Forecasting) รายงานสนคาคงเหลอสตอกกลาง หรอ มนบาร รายงานการใชหองพก (Room Occupancy) รายงาน ยอดการจองหองพกลวงหนา (Forecast Report) และ รายงานอนๆ และเครองมอชวยเหลอในการทางาน (Front Utility) อกมากมาย

คณสมบตของ โปรแกรมโรงแรม

ระบบโรงแรม คออะไร ?

Page 7: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Business model•ชอ•ทตง ทอย•ใครเปนเจาของ•ดาเนนกจการมาแลวกป•จานวนหองพก•ประเภท•พนกงาน•แผนก ฝาย•รายละเอยดตางเกยวกบ การทาธรกจ โรงแรม•ฯลฯ

Business model

Business Rule

Page 8: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Business Rule เงอนไข ของธรกจ

•การเขาพก ทาอยางไร•การเปนสมาชก / ทาอยางไร•การจอง•การจายเงน•การรบพนกงาน•การตอนรบลกคา

Page 9: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

การจองเพอจะ ตรวจสอบสถานะของหอง?

Page 10: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง Business Rule

Page 11: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง Business Ruleบรษท เอม บ เค จากด(มหาชน) เปนผประกอบธรกจระดบแนวหนาของประเทศไทย โดยมงเนนธรกจทสนบสนนดานการทองเทยว และการพฒนาอสงหารมทรพย เปนหลก

บรษท เอม บ เค จากด(มหาชน) เปนผประกอบธรกจระดบแนวหนาของประเทศไทย โดยมงเนนธรกจทสนบสนนดานการทองเทยว และการพฒนาอสงหารมทรพย เปนหลก โดย MBK ไดจดทะเบยนแปรสภาพบรษท เปนบรษทมหาชนจากดชอวา “บรษท เอม บ เค พรอพเพอรตส แอนด ดเวลลอปเมนท จากด (มหาชน)”เมอวนท 8 เมษายน 2537 และไดรบอนญาตให เปนบรษทจดทะเบยนในตลาดหลกทรพยแหงประเทศไทย อกครงเมอวนท 5 เมษายน 2539 ใชชอยอหลกทรพยวา “MBK - PD” โดยเรมมการซอขาย หนสามญ ของบรษทฯ ในตลาดหลกทรพยแหงประเทศไทยเมอวนท 24 เมษายน 2539ตอมาเมอวนท 20 พฤศจกายน 2545 บรษทฯ ไดเปลยนชอบรษทจาก “บรษท เอม บ เค พรอพเพอรตส แอนด ดเวลลอปเมนท จากด (มหาชน)” เปน “บรษท เอม บ เค ดเวลลอปเมนท จากด (มหาชน)” และเมอวนท 10 พฤศจกายน 2546 บรษทฯ ไดเปลยนชอบรษทฯ อกครงจาก “บรษท เอม บ เค ดเวลลอปเมนท จากด (มหาชน)” เปน “บรษท เอม บ เค จากด (มหาชน) ” “MBK” และเปลยนชอยอหลกทรพยจาก “MBK - PD” เปน “MBK” จนถงปจจบนMBK ประกอบดวย 8 กลมธรกจ คอ1. ธรกจศนยการคา 2. ธรกจโรงแรมและการทองเทยว 3.ธรกจอสงหารมทรพย 4.ธรกจกอลฟ 5. ธรกจขาว 6. ธรกจการเงน 7.ธรกจอนๆ 8. ธรกจสนบสนน ดงน

Page 12: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

บรษท เอม บ เคMBK ประกอบดวย 8 กลมธรกจ คอ

Page 13: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง Business Rule

Page 14: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง Business Model

Page 15: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

UML : Unified Modeling Language

Use CaseDiagramsUse Case

DiagramsUse CaseDiagrams

ScenarioDiagramsCollaboration

Diagrams

StateDiagramsState

DiagramsComponentDiagrams

ComponentDiagramsComponent

DiagramsDeploymentDiagrams

StateDiagramsState

DiagramsObjectDiagrams

ScenarioDiagramsScenario

DiagramsStatechartDiagrams

Use CaseDiagramsUse Case

DiagramsSequenceDiagrams

StateDiagramsState

DiagramsClassDiagrams

ActivityDiagrams

Models

http://www.siam2dev.com [ dr. nattapong songneam]

Page 16: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

1. Software Development Process

1. Requirement Specification : define problem domain

2. Analysis : what problem to be solved? (อะไรคอปญหาทตองแก)

3. Design : how to solve the problem? (แกอยางไร)

4. Implementation : how to implement the solution?

5. Testing : how to ensure that the solution can solve the problem?

1. ทดสอบในเรองความเรว ประสทธภาพ ความปลอดภย ความมนคง เสถยร

2. ทดสอบความเขากนได หรอ การประกอบของสวนยอยๆ

6. Maintenance : how to adjust the solution to accomodate change?

1. ในรอบระยะเวลาหนงอาจจะตองมการปรบเปลยน

7. Retirement : when does the system to be retired?

บทท 5 Requirement Specification

Use case

Page 17: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

StopA

A

หา Business Rule/Model

Start

Planning

Requirement Specification

สราง Use Case Diagram

สราง Class diagram

ออกแบบ UI and Prototype

Implementation /coding

Testing

Page 18: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

อ.ดร. นฐพงศ สงเนยม 18

ขอกาหนดของความตองการ(Requirement Specifications)

Page 19: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

2. System Analysis• กระบวนการวเคราะหระบบ (system analysis phase)

– มงเนน “what” ทระบบจะตองม และตองทาใหกบผใช โดยยงไมเนน “how” วาจะทาอยางไร (ในขนตอนนเปนการ User Requirement)

• กระบวนการวเคราะหความตองการของผใชระบบ (Requirementanalysis phase)– ใชในการสรางแบบจาลองหนาทการทางานของระบบ

ซอฟตแวร จากมมมองของผใชภายนอก หรอ ระบบภายนอก– จะไดแบบจาลองของความตองการของผใชระบบ

(Requirement Model) เปน Output

จาก UP ในเฟส ท 2 สงจะตองได หรอเสรจ กคอ Use case 80%

Page 20: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

What >> Analysis1. ระบบตองขายสนคาได2. เกบขอมลพนกงานได3. ....

How >> Design / Implement– ออกแบบ ขอ 1. ใน Traditional Method กคอการ ออกแบบ

อลกอรทม/Pseudo Code, และเขยนผงงาน / ผงโครงสราง– แบบเชงวตถ กสรางเปน use case diagram และ class diagram

Requirement Specification

Page 21: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ระบบขายสนคา

ซอ

ลกคา

สนคา/ ใบเสรจ

ขอมลสนคา

โปรแกรม ตองทางาน

อยางไร

Cjava

การซอ จะตองเขยนโปรแกรมอยางไร

Page 22: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In
Page 23: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

การเกบขอมลลกคา มความตองการ อะไร

1. ขอกาหนดของความตองน คอ จะทาอยางไร กบขอมลน มความตองการอะไรบาง

2. เชน ในการจดเกบหรอบนทกขอมลลกคา มเงอนไข หรอขอกาหนดตางๆ ดงน

1. การเกบขอมล จะตองเกบใหครบได รหส เลขทบตรประชาชน ชอ ทอย เบอรโทร เพศ สถานะ อเมล ขอมลเหลานจะตองเกบลงในฐานขอมล

2. จะขาดสงใดสงหนงไมได ระบบจะตองไมยอมใหบนทก

3. เบอรโทร จะเกบ 10 หลก หามเกน หามขาด

4. เบอรโทรจะตองไมเปนตวอกษร

5. เลขทบตรประชาชน จะตองเปน 13 หลก และเปนตวเลขเทานน

6. สถานะ จะตองประกอบไปดวย โสด สมรส อยาราง

7. อเมล จะตองถกตองตามหลก โดยม @

122233333333333

เลขทบตรประชาชน

ความตองการนมาจากผใช end user/ system ownerเจาของความตองการ โดยแทจรงไมใชลกคา

Page 24: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Requirements

1.

ออกแบบ Use case

2.

ทาไมตอง 1-2 เดอน หรอ ทาไม 3-4 หรอเทาไร ?

Page 25: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

3. System Analysis and Use Case

• Use Case Model– แบบจาลองความตองการของระบบ ท นาเสนอ functional

requirement ของระบบโดยรวม จากมมมองของผใช ภายนอก หรอ ระบบภายนอก

– ระบพฤตกรรม หรอหนาทการทางานของระบบ (เนน “what”) ทระบบตองม

– ใชในการทดสอบ และตรวจสอบ โครงสราง และหนาทการทางานของระบบ

– ใน UML สามารถระบเปน / เราสามารถเขยน use case ได 2 แบบ คอ

• Use Case Description (Text) หรอ • Use Case Diagram(Diagram)

บทท 5

Page 26: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ความแตกตางระหวาง what และ how

• What คอระบบนน จะตองมมความตองการหรอฟงกชนอะไรบาง

• How แตละความตองการหรอฟงกชน จะทาอยางไร

Page 27: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ระบบโรงแรม ทาอะไรบาง

•Functional requirements ?•Non-Functional requirements ?

Page 28: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ความตองการของระบบโรงพยาบาล

จงบอกความตองการตอไปน ขอใดเปนฟงกชน และขอใดไมเปนฟงกชน

1. ระบบจะเกบขอมลลกคาได .....................เปน..............................

2. ระบบสามารถเรยกใชงานไดทนท ...................เปน............................

3. ระบบสามารถรองรบการเชอมตอกบ Linux ………………เปน……………4. ระบบสามารถใชงานผาน wifi ได .........................ไมเปน...............................5. ระบบจะตองรายงานยอดผ ปวย แตละวนได ......................เปน.....................

6. ระบบจะตองบนการจายยาได ...................................เปน..........................

7. ระบบจะตองตรวจสอบขอมลผ ปวยแตละโรคได ...............เปน..........................

8. ระบบจะตองรนผาน iOS ได ..................ไมเปน.....................................9. ระบบจะตองใชงานงาย ..............................ไมเปน................................

10. ระบบจะตองรนไดทก browser ………………ไมเปน…………………..

Page 29: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Requirement

• Req08 : คนหาขอมลหองพก{ จากความตองการของ พนกงาน }

– ระบบจะตองสามารถคนหาวาหองพกใด วาง/ไมวาง– ระบบสามารถตรวจสอบไดวาหองใด มลกคาคนใดเขาพก– ระบบสามารถตรวจสอบไดวา หองพกนน ครบกาหนด Check

out วนไหน/เมอไหร– ระบบสามารถตรวจสอบได วา ลกคา ใชบรการ Minibar

หรอไม– ตรวจสอบวามแมบานทาความสะอาดแลวหรอไม

Req01 , Req08 , Req15 , Req20 , Req09 , Req07, Req02

เปนฟงกชน หรอไมเปน

Page 30: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ลกคา

พนกงาน

คนหา

หองพก

ระบบเวบแอพพลเคชนจองหองพกออนไลน

ถาเปนออนไลน ลกคาสามารถเขาไปเซคหองพกไดวาวาง

หรอไมวาง

Page 31: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ลกคา

พนกงาน

คนหา

หองพก

ระบบการจองหองพกโรงแรมถาเปนระบบวนโดวแอพพลเคชน ลกคาจะไมสามารถเขาไปเซคหองพกไดวาวางหรอไม

วาง จะตอสอบถามผานพนกงาน

ตรวจสอบผ

เขาพก

<<include>>

Login

minibarจองหองพก

Page 32: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ลกคา

พนกงานคนหา

หองพก

ระบบการจองหองพกโรงแรมถาเปนระบบวนโดวแอพพลเคชน ลกคาจะไมสามารถเขาไปเซคหองพกไดวาวางหรอไม

วาง จะตอสอบถามผานพนกงาน

ตรวจสอบผ

เขาพก

Login

minibarจองหองพก

หองพกวาง

Validate Client

Page 33: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

การพฒนาระบบจองหองพกโรงแรม ม Requirement ?

• Req01 : คนหาขอมลหองพก

• Req02 : สมครสมาชกได

• Req03 : จองหองพก

• Req04 : ชาระเงน

• Req05 : คนเงน

• ReqN : คนหองพก

Functional requirement

Page 34: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

วาง และ พรอมเขาพก

ไมวาง และ มคนอย

วาง แต ไมพรอมเขาพก / ยงไมทาความสะอาด

Page 35: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

จงวเคราะหระบบโรงแรม แลว เขยน

• Functional requirements ?• Non-Functional requirements ?

อยางละ 10

รายการ

Page 36: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ต.ย. Functional Requirements

• Req01 : การจองหองพก• { จากความตองการของ ลกคา }

– ในการจองหองพก จะมเงอนไขดงน• ระบบจะตองตรวจสอบขอมลการสมาชกได • ระบบจะตองทาการบนทกวาขอมลผจอง ไดแก รหส ชอ-นามสกล

เบอรโทร ทอย• ระบบจะตองสามารถตรวจสอบไดวา มหองวาหรอไม {uses Req08}• จะสามารถบนทกขอมลการจองหองพกได {uses Req09} โดยเกบ

วนท เวลา จานวนหอง จานวนผเขาพก วนทเชคอน วนท เชคเอาท• ระบบสามารถ ตรวจสอบไดภายหลงวา พนกงานคนใดเปนผรบการ

จอง• ถาเปนสมาชก จะมสวนลด 10 % {extend Req10}

จอง

ตรวจสอบหองพก

Page 37: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

โปรแกรมยอย

• Sub(vb)/Procedure(pascal)• Function/

• Function/Method• คนคา

• ไมคนคา

Page 38: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ต.ย. Functional Requirements

• Req01 : สมครสมาชก• { จากความตองการของ ลกคา }

– ในการ สมครสมาชกจะมเงอนไขดงน• ระบบจะตองตรวจสอบขอมลการสมาชกได • ระบบจะตองทาการบนทกวาขอมลผจอง ไดแก รหส

เลขทบตรประชาชน ชอ-นามสกล เบอรโทร ทอย• ระบบตองตรวจสอบ ขอมลเลขทบตรประชาชน ทถกตอง

ได 13 หลก

Page 39: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ผใชระบบสารสนเทศ:แหลงของความตองการ

• เจาของระบบ (System owners/Sponsors ) – มสวนไดสวนไดเสยจากการลงทนสรางระบบสารสนเทศ

เจาของผบรหาร ผจดการ• ผใชภายใน (Internal users)

– End-users คอผใชทปอนขอมลเขาสระบบโดยตรง ไมจาเปนตองมทกษะหรอความรมาก เนนความถกตองและรวดเรวของการปอนขอมลเขาสระบบ

– Power-users คอผใชทมความรความชานาญเฉพาะดาน สามารถใชงานฟงกชนของระบบในสวนทมความซบซอนได

– Administrators คอผทดแลและควบคมใหระบบสามารถดาเนนการไดอยางราบรนตามวตถประสงคทตงไว

– Executive users คอผใชทตองการสารสนเทศมาเพอการตดสนใจและบรหารองคกร

• ผใชภายนอก (External users)– ผใชซ งเปนบคคลภายนอกองคกร แตสามารถเขาถงบรการของ

ระบบในองคกรได

จากทเคยสอนไปแลว บทท 5

Page 40: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use Case Description Example

• Name: การสงรายการซอขายหลกทรพย (Place Order)– Main flow of events:

1. Trader ปอนชอ และรหสของ client2. System ตรวจสอบ (Validate) ชอ รหส และ credit ของ

client3. Trader ปอนรหสหลกทรพย จานวนหลกทรพย และราคา

หลกทรพย ท Client ตองการซอขาย4. System ตรวจสอบเงอนไขราคาของหลกทรพย

{ตรงกบเงอนไขของตลาดหรอไม เชน Margin ขนตาเทาไร}5. System สง order ใหกบตลาดหลกทรพย6. System เกบหมายเลข order ทไดรบจากตลาดหลกทรพย7. System แจงให Trader ทราบ

Trader

Place OrderStock

Exchange Market

Use case ไดมาจาก Requirement Specification

Page 41: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

4. Use Case Diagram• นาเสนอฟงกชนหรอ Use Case และการปฏสมพนธโตตอบกน

ระหวางระบบ และ ผใชภายนอก (someone / something อาจเปนคน หรอระบบกได)

• สวนประกอบของ use case diagram ดวย– Use Case – ฟงกชน/ความสามารถ/หนาทของระบบ– Actor – ผทมบทบาท/ ผกระทา/ผใชงาน Use Case นนๆ– Relationship - เสนแสดงความสมพนธระหวาง Use Case กบ

Actor– System / System Boundary - ระบบทกาลงพฒนา

Page 42: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use Case Modeling : Core Elements

Construct Description Syntax

use case A sequence of actions, including variants, that a system (or other entity) can perform, interacting with actors of the system.

actor A coherent set of roles that users of use cases play when interacting with these use cases.

system boundary

Represents the boundary between the physical system and the actors who interact with the physical system.

UseCaseName

ActorName

Page 43: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Construct Description Syntax

association The participation of an actor in a use case. i.e., instance of an actor and instances of a use case communicate with each other.

generalization A taxonomic relationship between a more general use case and a more specific use case.

extend A relationship from an extension use case to a base use case, specifying how the behavior for the extension use case can be inserted into the behavior defined for the base use case.

Use Case Modeling : Core Relationships

<<extend>>

Page 44: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Construct Description Syntax

Include / uses An relationship from a base use case to an inclusion use case, specifying how the behavior for the inclusion use case is inserted into the behavior defined for the base use case.

Use Case Modeling : Core Relationships (cont’d)

<<include>>

Page 45: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use Cases v.s. Scenario• Use Case

– ความสามารถ หรอ หนาทการทางานของระบบ– แตละ Use Case แทนชดของ transactions ทระบบ

ทางานโตตอบกบ ผใชงาน หรอระบบอนๆ ภายนอก• Scenario

– สถานการณ หรอตวอยางเรองราวการใชงานระบบ– Scenario จดเปน instance ของ use case– เชน

withdrawal cash

a user withdrawals$200

รายการ

การถอนเงนสด

อาจจะเปนของใครกได

เปนการระบรายละเอยด

หรอ ยกตวอยางมา 1

รายการ

Page 46: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ซอขาว

นาย ก. แลกคปอง 100 บาทแลกคปอง

สวมล ซอขาวมนไก 30 บาท

Page 47: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Scenario is a capture of use case

ถอนรายวชา

เพมรายวชา

•สมชายถอนรายวชา OOAD•สมศร ถอนวชาแคลคลส•สมควร ถอนวชา OOP

scenarioUse case

สมหญงเพมรายวชา OOP

การสมครสมาชก นาย นฐพงศ สมครบตรเครดตนาย สมศร สมครสมาชก MK

class Instances/objects

Page 48: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

จองหองพก

ตรวจสอบหองวาง

นายแดงจองหอง 142นาย ก จองหองพก เลขท 321...

scenariousecase

สมศรตรวจสอบหอง 142

Page 49: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

อะไรคอ Transaction ?

• ราน เซเวน– ขายสนคา– ซอสนคา– เพมขอมลสนคา– เปลยนราคาสนคา– คนหารายการสนคา

• โรงภาพยนตร• โรงแรม

Transaction หลายๆ transaction รวมเปน use case อาจกลาวได วา use case กคอ

requirement นนเอง

Page 50: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ระบบ รานเซเวน

• Use case ซอสนคา• Scenario : สมศร ซอแปรงสฟน 2 อน• Scenario : นายก. ซอขนมปง 5 ชน

ใชตอนทดสอบโปรแกรม

ซอสนคา

ใชตอน นา use case ไปทดสอบระบบ

Page 51: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Transaction

แปรงสฟน 2 ดาม

ขนมเลย 1 หอ

ขนมปง 1 หอ

นม 1 โหล

Page 52: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

• Use case : คานวณ พท. สเหลยม• Scenario :: สเหลยมท ก 2 ยาว 4

ใชในตอนออกแบบ วาโปรแกรมตองทาอะไรไดบาง

ใชในตอนทดสอบระบบ วาเปนไปตาม use case หรอไม

Page 53: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Actors• Actor หมายถง someone หรอ some thing ทมการ

ปฏสมพนธ โตตอบกบระบบ– สงใดกตามทมความตองการในการแลกเปลยน

information กบระบบ หรอ สงใดกตามทอยภายนอกระบบ และมการใชงาน Use Case ของระบบ

– กาหนดบทบาทหนาทของผใชระบบ (actor ใชสาหรบกาหนดบทบาท ของผใชระบบ วาทาอะไรกบระบบ หรอใช อะไร/ตดตอจากระบบ)

– กาหนดการเชอมโยงกบระบบอนๆ ภายนอก• ตวอยางของ Actors

– Customer -- maintain their account (ลกคาตองการปรบปรงรายการบญชของตวเอง)

– Cashier -- verify withdrawal amountCustomer Cashier

เวลา คณถอนเงน แคชเชยร สามารถตรวจสอบยอดการถอนได

Page 54: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ในการเกบขอมลลกคา• Req05 : จดการขอมลลกคา

– เพมลกคาใหม/สมครสมาชก– แกไขขอมลลกคา {customer/staff/admin}– จะตองใหลกคาสามารถด ขอมลตนเองได– จะตองใหลกคา แกไข ขอมลลกคา บางอยางได Customer -- maintain their

account (ลกคาตองการปรบปรงรายการบญชของตวเอง)

Customer

Maintain their account

Add new customer Staff

คลนก ลกคา ตองการแกไขทอย ผานเคาเตอร / พยาบาล

Delete account

Admin

Page 55: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Actor หมายถง someone หรอ some thing ทมการปฏสมพนธ โตตอบกบระบบสงใดกตามทมความตองการในการแลกเปลยน information กบระบบ หรอ สงใดกตามทอยภายนอกระบบ และมการใชงาน Use Case ของระบบกาหนดบทบาทหนาทของผใชระบบกาหนดการเชอมโยงกบระบบอนๆ ภายนอก

ATMchkpassword

Actor

ATM

customer

Validate account

<<

include>>

Page 56: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Actors• Actors สามารถอธบายโดยใช Generalization/Specialization

Relationship

• อาจพจารณา Actors เปนคลาส ใน UML เนองจากม relationships เชนเดยวกบทคลาสม

Generalization/specialization relationship

Customer

ATM Customer Cashier Customerจงอธบายรปน ?

แบงโดยใชเกณฑ ลกษณะของการใชงาน

Page 57: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Actors• Actors สามารถอธบายโดยใช Generalization/Specialization

Relationship

• อาจพจารณา Actors เปนคลาส ใน UML เนองจากม relationships เชนเดยวกบทคลาสม

Generalization/specialization relationship

Customer

Personal Customer Coporate Customer

จงอธบายรปน ?

แบงโดยใชเกณฑ ลกษณะลกษณะของลกคา

Page 58: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Actors• เชอมตอกบ use cases โดยใชเสนแสดงความเกยวของ ปฏสมพนธ

(association)• association = ความสมพนธทมการตดตอสอสารกน (ทงการรบ และสง

messages ใหแกกนและกน)

• ใช generalization relationships อธบายความสมพนธ ระหวาง actors ไมจาเปนตองอธบายรายละเอยดของ Association เนองจากไมมการ Implement สวนของ Actor ในระบบ

Customer withdrawal cash

Page 59: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

System• System

– อาจหมายถง Software system, business, hardware,..– วตถประสงคใน use-case modeling เพอระบขอบเขต

ของระบบทกาลงพฒนา (system boundary)• ใชสญลกษณ

System System

Page 60: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

System & Use cases

• A system there are several use cases.

usecase3

usecase5

usecase2

Usecase1 usecase

N

usecase4

Page 61: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

• ในระบบหนงๆ จะม ยสเคสไดอะแกรมไดหลาย ยสเคสไดอะแกรม• ในแตละยสเคสไดอะแกรม จะมหลายๆ ยสเคส

usecase1

usecase2

usecase3

usecase4

usecase

usecase

Usecase 1

usecase

ระบบใหญ

Use case 1

Page 62: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

จดการลกคา

• เกบประวต • แกไข• ลบ• คน

Page 63: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Relationships between Use Case

• Extends : เปน generalization relationships ในกรณท Use Case หนงๆ ขยาย (extends) Use Case อน โดยการเพมการกระทา (actions)

• Includes/Uses : เปน generalization relationship ในกรณทUse Case หนงๆ เรยกใช (uses) Use Case อน ทพจารณาให เปนสวนหนงของ Use Case นนๆ

Page 64: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Generalization Relationship• Child Use case รบถายทอด

คณสมบตมาจาก Parent Use Case

• Child สามารถเปลยนแปลงพฤตกรรมทรบจาก Parent หรอเพมเตมพฤตกรรม

• Child อาจนาไปแทนท ในทๆ Parent ปรากฏ

Validate client

Check password

Retinal scan

จงอธบายรปน ?

ตวลกมเหมอนพอแม แตสามารถดดแปแลงเพมเตมความสามารถของพอแมได

Parent use case

child use case

Page 65: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

“Include” relationship• มกใชในการหลกเลยงการอธบายการไหลของเหตการณ (flow of events) เดม ซา

กนหลายๆ ครง โดยรวบรวมพฤตกรรมรวม ใน Use Case

• หลกเลยงการ copy & paste ของ Use Case Descriptions

• เปรยบเสมอนการเรยกโปรแกรมยอย/ฟงกชน จากโปรแกรมหลก

Validate client

Place order

<<include>>

Track order

<<include>>

ทกครงทจะซอ/

ขาย ตอง login

โปรแกรมหลก

โปรแกรมยอย

Page 66: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

“Include” relationship• มกใชในการหลกเลยงการอธบายการไหลของเหตการณ (flow of events) เดม ซา

กนหลายๆ ครง โดยรวบรวมพฤตกรรมรวม ใน Use Case

• หลกเลยงการ copy & paste ของ Use Case Descriptions

• เปรยบเสมอนการเรยกโปรแกรมยอย/ฟงกชน จากโปรแกรมหลก

Validate client

Place order

<<include>>

Track order

<<include>>

ทกครงทจะซอ/

ขาย ตอง login

โปรแกรมหลก

โปรแกรมยอย

Trader

Page 67: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Read mail

Login

<<include>>

Post FB

Login

<<include>>

ใน UML ไมไดกลาวถงมาตรฐาน ส แปลวา ไมกาหนดวาสใดหมายถงอะไร แตสญลกษณ ถกกาหนดไว

Page 68: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

“Include” Example• Name : การตรวจสอบรายการซอขายหลกทรพย

(Track Order) – Main flow:

1. ใชหมายเลข order ในการตรวจสอบ ทไดรบจากตลาดหลกทรพยObtain and verify order number

2. Include สวนของ “Validate client”3. ในแตละสวนของ Order …

Track Order ValidateClient

<<include>>

Use case description

Use case diagram

Page 69: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

“Extend” relationship

• ใชสรางแบบจาลองบางสวนของ Use Case ท user อาจมองเปน optional– Optional หมายถง นอกเหนอ จาก

เหตการณปกต หรอมากกวาปกต หรอพเศษ• ต.ย. สมครเรยน เอกสารขาดไมครบ• การลงทะเบยน เงนไมพอ

• ใช สรางแบบจาลอง conditional subflows

• ใชในการแทรก subflows ในจดทระบโดยพจารณา ปฏสมพนธระหวาง Actors

<<extend>>(set priority)

Place orderExtension points:

Set priority

Place rush order

conditional

Page 70: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

“Extend” Example• Name : ¡ÒÃÊ‹§ÃÒ¡Òë×éÍ¢ÒÂËÅÑ¡·ÃѾÂ� (Place Order)

– Main flow of events:1. …2. Trader »‡Í¹à§×è͹䢢ͧËÅÑ¡·ÃѾÂ� ·Õè Client µŒÍ§¡ÒÃ

«×éÍ¢ÒÂ3. ¡íÒ˹´ÅíÒ Ñº¤ÇÒÁÊíÒ¤ÑÞ â´Â (set priority)4. System Ê‹§ order ãËŒ¡ÑºµÅÒ´ËÅÑ¡·ÃѾÂ�5. ...

Place Order Place RushOrder

<<extend>>

[ ]optional

Page 71: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Relationships between Use Case

WithdrawalCash

ValidateAccount

<<include>>

Ship PartialOrder

Ship Order

<<extend>>

Page 72: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Comparing extends/ uses• extend

– ใชแยกความแตกตางของ Use Case – actors ทเกยวของมกเปนคนกระทา Use case และUse

Case ทextend ทงหมด– actor มกเชอมตอกบ “base” Use Case

• include/use– ใช extract พฤตกรรมรวม– มกไมม actor เกยวของโดยตรงกบ Use Case ทม

พฤตกรรมรวม– actors ทแตกตางกน for “caller” use cases possible

Page 73: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

A Use Case Diagram

Establish Credit

<<include>>

Trader

Validate Client

<<include>>

PlaceOrder

<<extend>>FinancialOfficer

TrackOrder

RetinalScan

CheckPassword

Place RushOrder

StockExchange

<<include>>

someone

someone

something

ให Problem Domain มา แลว functional / non-functional แลวสรางเปน usecase

Page 74: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

A Use Case Diagram

<<include>>

Customer

Validate Account

<<include>>

BankTeller

Deposit

BalanceChecking

Transfer

Withdraw

Verifywithdrawal

<<include>>

ATM/CDM

ตอนทถอน มการตรวจสอบยอดเงนคงเหลอ /หมายถงธนาคารตองเชคกอน

<<include>>

<<include>>

Verify Transfer

ตรวจสอบเลข บช.ตรวจสอบจานวนเงน

Page 75: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

A Use Case Diagram

<<include>>

Customer

Validate Account

<<include>>

BankTeller

Deposit

BalanceChecking

Transfer

Withdraw

Verifywithdrawal

<<include>>

<<include>>

ATM/CDM

ตอนทถอน มการตรวจสอบยอดเงนคงเหลอ /หมายถงธนาคารตองเชคกอน

Page 76: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Validate Account

Function Balance_checking() If balance >= amt then

balance = balance -amtElse

msgbox “เงนไมพอ”End if

End Funciton

WidtdrawBalance_Checking ()

..……

Implement with Visual Basic

Page 77: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Balance Checking

If balance >= amt thenbalance = balance - amt

Elsemsgbox “เงนไมพอ”

End if

WidtdrawBalanceChecking()

..……

BalanceChecking()

Page 78: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

When and how?• Requirements capture

– ใชในการกาหนด Reuqirement ของระบบ– สรางแบบจาลอง (Model) ของ user requirements

ดวย Use Case• Test Scenarios

– สรางแบบจาลอง (Model) ของสถานการณการทดสอบระบบ (test scenarios) ดวย Use Case

• Use Case: – ระบส งท Actor ตองการใหมในระบบ– ต งชอให Use Case– เขยนคาอธบายส นๆ– เพมรายละเอยดในภายหลง

เปนหนาทของ use case specified

เปนหนาทของ use case designer

Presenter
Presentation Notes
Sources for identifying use cases: Think about potential actors Think about potential external events
Page 79: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Finding Actors• สามารถระบ actor ไดโดยตอบคาถามตอไปน

– ใครเปนคนใชงานหนาทการทางานหลกของระบบ (primary actors)?– ใครตองการการสนบสนนการทางานจากระบบ?– ใครตองการบารงรกษา และบรหารระบบ (secondary actors)?– Hardware devices ใดทตองการใหระบบจดการดแล?

• ถาระบบฮารดแวร เครองจกรใด ตองการการซอมบารง / เครองจกรไมใชคน– ระบบภายนอกระบบใดท ตองการใหระบบมปฏสมพนธดวย?

• ระบบจายคานาประปา -- ไมใชคน แตเปนระบบ• ระบบเกบภาษ/จายภาษ – สรรพากร ไมใชคน

– ใคร หรอ อะไรทตองการไดรบผลประโยชน จาก output ของระบบ? • หลงจาก use case ทางานแลว สงผลลพธให ใคร

• Tips– ไมควรพจารณาเฉพาะ users ทใชงานระบบโดยตรง แต พจารณา users

อนๆ ทตองการใชบรการจากระบบดวย

association

Page 80: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

หา Actors

จายเงนเดอน

ระบบจายเงนเดอนของ ขาราชการ ในมหาวทยาลย

ขาราชการ พนกงงานฝายบคคล

พนกงงานฝายบคคล

Page 81: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Finding Use Cases• สาหรบแตละ actor ตอบคาถามตอไปน

– หนาทการทางานอะไรท actor ตองการจากระบบ?– ขอมลใดบางท actor ตองการสราง อาน ลบ เปลยนแปลง หรอ

เกบอยภายในระบบ?– เหตการณใดบางทระบบตองแจงให actor ทราบ? หรอ actor

ตองแจงใหระบบทราบ? – หนาทการทางานของระบบ ชวยทาใหงานประจาวนของ actor

งายขนหรอไม?• ถาไมพจารณา actors

– อะไรคอ input/output ของระบบ ? input/output เหลานนมาจากไหน หรอใครเปนคนนาไปใชงาน?

– ปญหาหลกของระบบทใชงานอย คออะไร?

Page 82: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

หนาทการทางานอะไรท actor ตองการจากระบบ?

Student

คนหาเกรด

เปลยนชอ

ถอนวชา

การปรบปรง

ขอมลนกศกษา

Page 83: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Recipe (เทคนค)• ระบ actors ทมปฏสมพนธกบระบบ• พจารณาแนวทางของระบบ ในการปฏสมพนธกบ

actors• จาแนกพฤตกรรมของระบบใน การปฏสมพนธกบ

actors ใหเปน use cases โดยกาหนดความสมพนธระหวาง Use Case

Page 84: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยางการเขยน Use case

Page 85: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง use case

• ผใชงานสอดบตร ATM เขาสเครองรบบตร หากบตรใชงานไดจงเขาสหนาจอ Main Menu หากใชงานไมไดบตร ATM จะถกปลอยคน (Reject) ออกมา หากบตรใชได ผใชงานตองระบประเภทบญชและจานวนเงนทตองการถอน หากมเงนในบญชมากกวาหรอเทากบจานวนทระบ ผใชงานสามารถนาเงนออกจากเครอง ATM ได

85

Page 86: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง scenario

Scenario ท 1• นายสมชายสอดบตร ATM ของธ.กรงเทพ สาขาหาดใหญ แต

บตรเสย บตรจงถก reject ออกมา

86

Page 87: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง scenario

Scenario ท 2• นางสมใจสอดบตร ATM ของธ.ทหารไทย สาขาบางเขน บตร

สามารถใชการได แตเงนในบญชไมพอจาย จงไมสามารถนาเงนไปใชได

87

Page 88: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง scenario

Scenario ท 3• นายสมบตสอดบตร ATM ของ ธ.ทหารไทย สาขาบางเขน บตร

สามารถใชการได และมเงนในบญชเพยงพอ เขาตองการถอน100 บาท และในบญชมเงนจานวน 250 บาท ดงนนนายสมบตจงสามารถนาเงนออกจากเครอง ATM ไปใชได

88

Page 89: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ต.ย. Use case diagram ทม uses

• จงสราง use case diagram เพออธบายการตรวจสอบ user ทเขามาในระบบคอมพวเตอรขององคกรตาง ๆ ตองมการตรวจสอบรหสผานรวมอยดวย โดย actor ของระบบนคอผจดการระบบ

89

Page 90: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ข นตอนท 1 :หา use case และ actor ของระบบ

• use case ของระบบคอ– การตรวจสอบ user (Validate user)– การตรวจสอบรหสผาน (Check password)

• actor ของระบบคอ– ผจดการระบบ (System Administrator)

90

Page 91: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ข นตอนท 2 : เขยน scenario ของระบบ

• scenario ท 1 : user ปอน password ทถกตอง– การตรวจสอบ password ใน use case ชอ check

password ตรวจสอบไดถกตอง ทาใหกจกรรมใน validate user ดาเนนตอไปได

91

Page 92: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ข นตอนท 2 : เขยน scenario ของระบบ

• scenario ท 2 : user ปอน password ทไมถกตอง– ทาให use case ชอ check password ถกเรยกใชอก

หลายครงจนกวาจะถก หรอจนกวาจะครบ 3 ครง จงตด user คนนนออกจากระบบ

92

Page 93: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ข นตอนท 3 : เขยน use case diagram

User Authorization

Validate Users Check Password

SystemAdministrator

<<uses>>

93

Page 94: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตย. Use case diagram ทม extends

• จงสราง use case diagram ทแสดงการรบโทรศพท ซงขณะทรบโทรศพทปกต หากมสายเรยกซอนเขามา อาจทาใหตองมการรบสายเรยกซอนกอน ซงทาใหการรบสายโทรศพทตามปกตตองชะงกชวคราว

94

Page 95: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ข นตอนท 1 : หา use case และ actor ของระบบ

• use case ของระบบคอ– การรบโทรศพท– การรบสายเรยกซอน

• actor ของระบบคอ– ผรบโทรศพท

95

Page 96: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ขนตอนท 2 : เขยน scenario ของระบบ

• scenario ท 1 : เกดสายเรยกซอน– เมอเกดสายเรยกซอน ทาให use case การรบโทรศพท เกด

การชะงกงน ซงผรบอาจหยดการสนทนาชวขณะ– หรอผรบเปลยนไปรบสายทเรยกซอนแทน

• scenario ท 2 : ไมเกดสายเรยกซอน

96

Page 97: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ข นตอนท 3 : เขยน use case diagram

การรบโทรศพท

รบโทรศพท รบสายเรยกซอน

ผรบโทรศพท

<<extends>>

97

Page 98: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ตวอยาง การเขยน use case diagram

• จงสราง use case diagram เพออธบายการลงทะเบยนของนกเรยน ซงเกดจากผลของการวเคราะหความตองการเบองตน สามารถเขยนเปนรายการไดดงน

98

Page 99: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ความตองการ (Requirement)

• ในแตละภาคการศกษาจะมการลงทะเบยนของนกศกษา โดยนกศกษาทลงทะเบยนในแตละภาคการศกษาจะม 2 ประเภทคอ– นกศกษาปจจบน– นกศกษาใหม

99

Page 100: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ความตองการ...

• การลงทะเบยนในแตละครงจะมการเกบหลกฐานและคาเลาเรยน • ซงการลงทะเบยนเรยนจะเสรจสนไดกตอเมอหลกฐานทไดรบมา

ครบถวนถกตอง• และในขณะเดยวกนเงนคาเลาเรยนทเรยกเกบไดกตองมจานวน

ครบถวนดวย

100

Page 101: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ความตองการ...

• เจาหนาทของสถาบนการศกษาจะเปนผจดการในเรองของการจดเกบหลกฐานและคาเลาเรยนทงหมด

• และผจายเงนตองเปนนกเรยนเทานน

101

Page 102: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

ความตองการ...

• สาหรบนกศกษาบางคนทไดรบสทธพเศษเชน– ไดรบทนเรยนฟร– เปนนกกฬาของสถาบน– หรอเปนผทาชอเสยงใหสถาบนจะมสทธไดรบยกเวนคาเลาเรยนในบางภาคการศกษา

102

Page 103: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

หา use case ของระบบ

• use case ของระบบคอ– การลงทะเบยนนกศกษา– การเกบหลกฐาน– การชาระคาเลาเรยน

103

Page 104: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

หา use case อนทเก ยวของ

• หา use case อนทเก ยวของคอ– การลงทะเบยนนกศกษา

• การลงทะเบยนนกศกษาใหม• การลงทะเบยนนกศกษาปจจบน

– การเกบหลกฐาน• หลกฐานไมพรอม

104

Page 105: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

หา use case อนทเก ยวของ

• หา use case อนทเก ยวของคอ– การชาระคาเลาเรยน

• มเงนไมพอชาระคาเลาเรยน• ไดรบการยกเวนคาเลาเรยน

105

Page 106: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

หา actor ของระบบ

• Actor ของระบบคอ– เจาหนาท– นกศกษา

106

Page 107: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

เขยน Use Case Diagram

ลงทะเบยนนกศกษาใหม

ลงทะเบยนนกศกษาปจจบน

ชาระเงนคาเลาเรยน

เกบหลกฐาน

หลกฐานไมพรอม

มเงนไมพอชาระคาเลาเรยน

ไดรบการยกเวนคาเลาเรยน

เจาหนาท

นกศกษา

<<uses>>

การลงทะเบยนเรยนของนกศกษา 107

Page 108: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

การเขยน Use caseองคประกอบมดงน

- ชอของ Use Case

- ภาพรวมของการทางาน (Overview)

- Actor หลก (Primary Actor)

- Actor รอง (Secondary Actor)

- จดเรมตน (Starting Point)

- จดสนสด (End point)

- การทางานของ Use Case (Flow of Events)

- การทางานของ Use Case เมอมปญหาเกดขน (Alternative flowof Events)

- ผลของการทางานของ Use Case (Measurable Result)

Page 109: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use Case : Create Order• ภาพรวมของการทางาน (Overview)

จดประสงคหลกของ Use Case น เพอทาการลงขอมลในใบสงซอสนคาจากลกคา

• Actor หลก (Primary Actor)ตวแทนฝายขายสนคา

• Actor รอง (Secondary Actor)ไมม

• จดเร มตน (Starting Point)Use Case ตวนเร มตนเมอ Actor ตวแทนฝายขายสนคาขอใหระบบ

ทาการลงขอมลการสงซอสนคา• จดสนสด (End point)

คาขอเพอทาการลงขอมลการสงซอสนคาเสรจสนสมบรณหรอไมกถกยกเลก

Page 110: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use Case : Create Orderการทางานของ Use Case (Flow of Events)

จาก User Interface บนจอเพอทาการลงขอมลการสงซอ Actorจะตองทาการใสขอมลเกยวกบการสงซอ เปนตนวา วนทลกคาตองการใหสนคาสงมอบถงมอ (Required Date) ปรมาณทตองการส งซอ (Quantity) ตองการใหสงมอบสนคาโดยบรษทสงสนคาไหน (Ship Via) ตองการใหใหสงมอบสนคาทไหน (Ship Address) หลงจากนนแลว Actor สามารถเลอกทจะทาการบนทกขอมลลงไปไวในฐานขอมล หรอยกเลกการทางานทงหมด ถา Actor เลอกทาการบนทก ใบสงซอใบใหมกจะถกสรางขนมาในฐานขอมล

Page 111: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use Case : Create Orderการทางานของ Use Case เมอมปญหาเกดขน

(Alternative Flow of Events)ถาไมมสนคาทตองการอยในคลงสนคา ระบบจะตองแจงให Actor ทราบพรอมกนนนกตองยกเลกการทางานทเหลอของUse Case น

ผลของการทางานของ Use Case (Measurable Result)จะมใบสงซอสนคาใหม 1 ใบขนมาในระบบ

Page 112: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Cash Register Example

Use Case: Buy items

Actors: Customer, Cashier

Type: Primary

Description: A Customer arrives at a checkout with items to purchase. The Cashier records the purchase itemsand collects payment. On completion, the Customer leaves with the items

Page 113: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Expanded Use Case Example

Use Case: Buy Items with Cash

Actors: Customer (initiator), Cashier

Purpose: Capture a sale and its cash payment

Overview: A Customer arrives at a checkout with items topurchase. The Cashier records the purchase items and collects a cash payment. Oncompletion, the Customer leaves with the items.

Type: primary and essential

Cross references: R1.1, R1.2, R1.7

Page 114: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Expanded Use Case (2)

1. This use case begins when a Customer arrives at the register with items to purchase.

2. The cashier records the identifier from each item. If more than one of the same item, the Cashier can enter the quantity as well.

4. Cashier indicates completion of item entry.

6. Cashier tells the Customer the total.

3. Determines the item price and adds the item information to the running sales transaction. The description and price of the item are presented.

5. Calculates and presents the sale total.

TYPICAL COURSE OF EVENTS

ACTOR ACTION SYSTEM RESPONSE

Page 115: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Expanded Use Case (3)

7. The Customer gives a cash payment -possibly greater than the sale total.

8. The Cashier records the cash received amount.

10. The Cashier deposits the cash received and extracts the balance owing. Cashier gives balance and receipt to Customer.

12. Customer leaves with items purchased.

ACTOR ACTION SYSTEM RESPONSE

9. Show the balance due

back to the Customer.

Generates a receipt.

11. Logs the completed

sale.

Page 116: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Expanded Use Case (4)

• Alternative Courses

• Line 2: Invalid identifier entered. Indicate error

• Line 7: Customer didn’t have enough cash. Cancel sales transaction

• If a Typical Course of Events has multiple equally likely courses of action

– indicate branches in Use case

– write a subsection for each branch indicating the typical course of events

– have alternatives for each subsection if necessary

Page 117: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

Use case ของ ระบบรบ-สงเมล

Page 118: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

http://i.stack.imgur.com/zAAcZ.jpg

Page 119: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

student teacher

member

Borrow book

Return Book

LibrarianCheckingMember

Check period

borrowed

Calculation fine

ระบบการยมหนงสอในหองสมด(Borrow book from library)

<<include>> <<

extend>>

Page 120: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

user customer CardAuthorization

CheckInventory Status

Object Actors Product

Page 121: Use case modelsiam2dev.net/E_Learning/OOAD/Lec07_OOAD_Use_case_model...The Iterative Approach OOAD : Object-Oriented Analysis and Design 5 Disciplines group activities logically In

แบบฝกหด

• จงเขยน functional requirement ของการจองหองพกโรงแรม1. เขยน Requirement Specification2. หา Actor3. หา use case4. เขยน 5 Scenario5. แลวเขยน use case diagram ของการจองหองพก

โรงแรม