Last Update :...
Transcript of Last Update :...
![Page 1: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/1.jpg)
http://www.siam2dev.com [ dr. nattapong songneam]
โดย อ.ดร. นฐพงศ สงเนยมhttp://[email protected]
สาขาวชา วทยาการคอมพวเตอรคณะวทยาศาสตรและเทคโนโลย มหาวทยาลยราชภฏพระนคร
Last Update : 14/12/2560
Lec05 : Introduction to UML
แหลงขอมลเพมเตม : : http://www.lumpaya.com/sdlc01.htm
![Page 2: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/2.jpg)
งานโปรเจกต สงไดตงแต
• กาหนดสงกอน สอบปลายภาค 1 สป.
• คร งหนา สง Requirement Specifications
![Page 3: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/3.jpg)
UML
http://www.siam2dev.com [ dr. nattapong songneam]
Use CaseDiagramsUse Case
DiagramsUse CaseDiagrams
ScenarioDiagramsCollaboration
Diagrams
StateDiagramsState
DiagramsComponentDiagrams
ComponentDiagramsComponent
DiagramsDeploymentDiagrams
StateDiagramsState
DiagramsObjectDiagrams
ScenarioDiagramsScenario
DiagramsStatechartDiagrams
Use CaseDiagramsUse Case
DiagramsSequenceDiagrams
StateDiagramsState
DiagramsClassDiagrams
ActivityDiagrams
Models
![Page 4: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/4.jpg)
การวเคราะหและออกแบบระบบเชงวตถ (OOAD)
Lec06 # Introduction to UML
โดย อ. นฐพงศ สงเนยมhttp://[email protected]
![Page 5: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/5.jpg)
Lecture Outline• Software Modeling
• Require and Domain Analysis Model
• Design Model
• Brief Overview of Unified Modeling Language (UML)
Updated : 27/12/2016
![Page 6: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/6.jpg)
Structural Programming
and OOP
Analysis and Design
Tradditional / OOAD
Introduction to Database ,
DBMS
SE : Software Engineering
• Software Management• Project Management
• ฯลฯ
• Algorithm
ER Design, Normalize, ER-Mapping , DBMS , DDL ,DML , DCL
ALGORITM , PSEUDOCODE , SYNTAX, FLOWCHART , SCREEN LAYOUT , Visual Programming ,Event-Driven Programming , Object Oriented
Programming
SDLC, DFD, Process Description, UP, Analysis , Design ,Requirement , Diagram , UML, Screen
Layout
![Page 7: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/7.jpg)
What is Modeling?• การสรางแบบจาลอง (Modeling)
– เปนวธการวเคราะห และออกแบบ (Analysis and Design) วธการหนงทเนนการสรางแบบจาลอง เพอใหสามารถเขาใจปญหาของระบบ
– ใชเปนเครองมอในการสอสาร แนวคดในการพฒนาระบบ กบบคคลอนๆ (ระหวางผพฒนาระบบดวยกน และกบบคคลอนๆ)
• Mathematics Model – เปนโมเดลทางคณตศาสตร เชน สมการ สตร
• Visual Modeling– Visual แปลวา ภาพ– Modeling กคอแบบจาลอง ดงนน Visual Modeling กคอ
ใชสญลกษณรปภาพในการสรางแบบจาลอง
1
n
ix
=∑
![Page 8: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/8.jpg)
• ต.ย. จงหาอายรวมของ นศ. วทยคอม 29
• 52 53 42 28 47 58 19
1
n
ix
=∑
0. Specified problem1. Requirement
2. การวเคราะห INPUT / PROCESS (algo) / OUTPUT
3. ออกแบบ Flowchart/ Structure chart / PSEUDO-CODE
![Page 9: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/9.jpg)
เปรยบเทยบ
• MODEL ทางานเสรจแลว แตอธบายงานใหงายขนกทาโมเดลขนมา
เพออธบายดวยวธการทงาย
• PROTOTYPE ยงไมไดทาตวจรง แตทาตวจาลองขนมากอน แลว เอา
ตวจาลองไปสรางเปนของจรง
![Page 10: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/10.jpg)
Software Modelingแบบจาลองของซอฟตวร
UserRequirement
Modeling(Analysis and Design)
Model(Specification)
Tools ManuallyCoding
Program
Implementation
![Page 11: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/11.jpg)
Models• Requirement Analysis Models (Requirement Specification)
ไดจากกระบวนการวเคราะหความตองการของผใชระบบ (Requirement Analysis)
• Analysis Modelไดจากกระบวนการวเคราะหหนาทการทางานของระบบ (System
Analysis)
• Design Modelไดจากกระบวนการออกแบบการทางานของระบบ (System Design)
![Page 12: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/12.jpg)
Software Development Process
• Requirement Specification : define problem domain
• Analysis : what problem to be solved? (อะไรคอปญหาทตองแก)
• Design : how to solve the problem? (แกอยางไร)
• Implementation : how to implement the solution?
• Testing : how to ensure that the solution can solve the problem?
– ทดสอบในเรองความเรว ประสทธภาพ ความปลอดภย ความม นคง เสถยร
– ความเขากนได Integrated System
• Maintenance : how to adjust the solution to accomodate change?
– ในรอบระยะเวลาหนงอาจจะตองมการปรบเปลยน
• Retirement : when does the system to be retired?
บทท 5 RequirmentSpecification
![Page 13: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/13.jpg)
• Divide & Conquer
componet1 componet2 componet3 componet4
Problem
Integrated System
Standard
![Page 14: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/14.jpg)
• ทาสไลด powerpoint 50 slide แบง 5 คน
– ถาพนหลง คนละส เวลารวมกน จะเปนอยางไร
![Page 15: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/15.jpg)
การคอนโทรล
• ควบคมดวยซอฟตแวร
• ควบคมดวย มาตรฐาน / ISO เชน UML
จะถกพดถงในรายวชา Software Project Management หรอ วชา Software Engineering
![Page 16: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/16.jpg)
Web application / Mobile App
• MVC : – M : Model – V : View– C : Control/Coding
![Page 17: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/17.jpg)
ระบบชอขายสนคา
• ปญหาเดม / ทมา ระบบเดม ขายโดยการจดบนทกในสมด ปญหา มขอผดพลาดเยอะ / ลาชา
• ReqID :: 01 ตองการใหระบบสามารถบนทกขอมลการขายสนคาได – ระบบจะตองทาการบนทก ขอมลสนคาไดทผซ อ ซอไป– ระบบจะตองจดเกบขอมลผซ อได – ระบบจะตองตรวจสอบไดวา พนกงานคนใดขายสนคาใหกบ
ลกคา– ระบบจะตองตรวจสอบจานวนสนคาในสตอกได
![Page 18: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/18.jpg)
Structured Analysis Modelsโมเดลการวเคราะหเชงโครงสราง
• Data Flow Diagrams :: DFD• Entity Relationship Diagrams : ERD• State-Transition Diagrams : STD
เปนโมเดลแบบดงเดมทใชสาหรบการวเคราะหระบบแบบเชงโครงสราง
![Page 19: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/19.jpg)
Object-Oriented Analysis Models
• Use-case Diagrams• Class and Object Diagrams• Behavioral Diagrams
เปนโมเดลทใชสาหรบการวเคราะหระบบเชงวตถ
![Page 20: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/20.jpg)
The Unified Modeling Language (UML)
![Page 21: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/21.jpg)
What is UML?• เปนภาษาทใชในการสรางแบบจาลอง (Modeling
Language) ทประกอบดวยองคความรทใชในการนาเสนอและออกแบบเอกสารประกอบโปรแกรม– คมอทางเทคนค Programmer Manual
• อธบายรายละเอยดทางเทคนค การวเคราะห การสราง การออกแบบ การทดสอบ
– คมอสาหรบผใช User Manual อธบาย การใชงานซอฟตแวร , การปอนขอมล การปรบปรงแกไขขนตน
• รวม 3 แนวคด/วธการเชงวตถท ไดแก Booch, Rumbaughและ Jacobson รวมทงจากบคคลอน
• จดรวบรวมออกมาเปนมาตรฐานสาหรบการแลกเปลยนแนวคดการออกแบบระบบ และองคความรในเชงเทคนคในรปของแบบจาลอง
![Page 22: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/22.jpg)
What is NOT UML?• ไมใชภาษาโปรแกรม (Programming Language)
– ไมใชภาษา VB , Pascal , Delphi , Java , C# etc.
• ใช method หรอ methodology {เปนวธการเปนกระบวนการ}
• ไมระบ Process ทใชในการทางาน• UML ใชในการสรางแบบจาลองการวเคราะห และออกแบบ
ระบบ โดยไมขนกบ Process• แตละโครงงานสามารถเลอก Process การทางาน ท
เหมาะสม กบสภาพความจรงของโครงงาน โดยไมขนกบ modeling language (สามารถใชกบภาษาโปแกรมใดกได)
![Page 23: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/23.jpg)
History of UML• 1970s ďńİŇřýńÐďĿ₣Ğő (Object-oriented method)• 1970s, 1980s, 1990s “Method Wars”
Grady Booch, Jim Rumbaugh, Ivar Jacobson• 3 ŚŞďŽń¾/ďńİŇł ŀăřýńÐďĿ₣ĞőğŇůřĆŮŞğŇůŞńĂ· ŢýŰŢŞýůďÐł ąŀÐ
ğĐďăăĘ 1990s ţ¾ŰŚł ů– OOSE (Object-Oriented Software
Engineering) ś¾Ă Ivar Jacobson– OMT (Object Modelling Technique) ś¾Ă Jim
Rumbaugh– Booch method ś¾Ă Grady Booch
• ĆĿ−Ěŀ¾ŰŀŞł ŀăęŐůĹęŀă ęĿ−ąĿł Ę¼źğŇůŢýŰŢŞŚ₣ůąľďńİŇł ŀăţ· ůřĚ· ŐĹŞł ĿŞ
![Page 24: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/24.jpg)
Histroy of UML• ในป 1994/5 Booch, Rumbaugh และ Jacobson (เรยก
ตวเองวา “three amigos”) รวมกนทาการรวบรวมแนวคดองคความร และเทคนคตางๆ เขาดวยกน ท Rational Software
• Three Amigos เสนอ Unified Modelling Language (UML) ไปยง หนวยงาน OMG (Object Management Group) เพอใหเปนภาษามาตรฐานสาหรบสรางแบบจาลองเชงวตถ
• UML Version 1.1 ไดถกพฒนาขนในป 1997 เพอเปนมาตรฐาน สาหรบสรางแบบจาลองเชงวตถ
![Page 25: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/25.jpg)
Histroy of UML• ป 1998 พฒา UML Version 1.2• ป 1999 พฒา UML Version 1.3• ป 2000 พฒา UML Version 1.4• ป 2001 พฒา UML Version 2.0 • http://www.uml.org/
![Page 26: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/26.jpg)
26
The Evolution of the UML:
UML1.1
UML1.0
UML0.9
Beta version OOPSLA’96
Public Feedback
Submission of OMG group
OMG vote’97Submission to OMG, sept’97
Unified Method 0.8
Other method Booch OMT OOSE
![Page 27: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/27.jpg)
Models and Diagrams
Use CaseDiagramsUse Case
DiagramsUse CaseDiagrams
ScenarioDiagramsScenario
DiagramsCollaborationDiagrams
StateDiagramsState
DiagramsComponentDiagrams
ComponentDiagramsComponent
DiagramsDeploymentDiagrams
StateDiagramsState
DiagramsObjectDiagrams
ScenarioDiagramsScenario
DiagramsStatechartDiagrams
Use CaseDiagramsUse Case
DiagramsSequenceDiagrams
StateDiagramsState
DiagramsClassDiagrams
ActivityDiagrams
A model is a completedescription of a systemfrom a particularperspective
Models
![Page 28: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/28.jpg)
UML 2UML 2 defines 14 diagrams (all supported by Enterprise Architect)1. Package diagrams2. Class or Structural diagrams3. Object diagrams4. Composite Structure5. Component diagrams6. Deployment diagrams7. Use Case Diagrams8. Activity diagrams9. State Machine diagrams10. Communication diagrams11. Sequence diagrams12. Timing diagrams13. Interaction Overview diagrams14. Profile diagrams
![Page 29: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/29.jpg)
ทาไมตองเปน UML• Development life cycle - สนบสนนท ง life cycle ของการพฒนา
ระบบ สามารถถกใชตงแตขนตอนการหาความตองการ (Requirements) จนถงขนตอนการทดสอบตดตงระบบ (Test & Installation)
• Implementation languages and platforms - ไมผกตดกบภาษาและแพลทฟอรม (platform) ของการ implement สนบสนนทง pure oolanguages เชน smalltalk java, c#. หรอ hybrid เชน c++ หรอ non-oo เชน c,pascal
• Application domains - สนบสนนการสราง application ในหลาย domain เชน information systems {MIS , EIS , ES , DSS,TPS}, embeded real-time systems, technical systems, distributed systems, system software
• Development process – สามารถใช UML รวมกบกรรมวธพฒนาระบบใดๆกได (prefer UP)
• Internal concepts – มหลกการทชด มนคง
![Page 30: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/30.jpg)
มมมอง UML (UML Views)
Major Area มมมอง (View) แผนภาพ (Diagrams)
โครงสราง(structural)
static view class diagram
use case view use case diagram
implementation viewdeployment view
component diagram
deployment diagram
สามารถใช UML สรางเปนโมเดลแสดงมมมองระบบไดเปน 3 กลม
พลวตร(dynamic)
state machine view state chart diagram
activity view activity diagram
interaction view sequence diagram
collaboration diagram
การจดการโมเดล(model
management)
model management view class diagram (package, subsystem)
![Page 31: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/31.jpg)
UP : Lifecycle Phases
• Inception Define the scope of the project and develop business case
time
Inception Elaboration Construction Transition
• Elaboration Plan project, specify features, and baseline the architecture
• Construction Build the product
• Transition Transition the product to its users
![Page 32: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/32.jpg)
![Page 33: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/33.jpg)
The Iterative Approach
OOAD : Object-Oriented Analysis and Design 33
Disciplinesgroup activities
logically
In an iteration,you walk through
all disciplines
33
![Page 34: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/34.jpg)
จ. อ. พ. พ.
![Page 35: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/35.jpg)
UML has 9 kinds of diagrams Class Diagram Object Diagram Component Diagram Deployment Diagram
Use Case Diagram Sequence Diagram Collaboration Diagram StateTransition Diagram Activity Diagram
Structural Diagrams(static diagrams)
Behavioral Diagrams(dynamic diagrams)
![Page 36: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/36.jpg)
UML(Unified Modeling Language)
• 5 มมมองหลกของ UML– Use-case view : หนาทการทางานของระบบซอฟตแวร
โดยพจารณาจากมมมองของผใชภายนอก หรอ ระบบภายนอก
• use-case diagram– Logical view : หนาทการทางานของระบบมโครงสราง
อยางไร มองในรปของ static structure และdynamicbehavior
• class diagram, object diagram, state, sequence, collaboration, activity diagrams
![Page 37: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/37.jpg)
UML(Unified Modeling Language)– Component view : องคประกอบยอยในการ implement ท
ประกอบเปนระบบ และ dependency ระหวางองคประกอบเหลาน น• component diagram
– Concurrency view: การแบงแยก process และ processors โดยพจารณาท ง communication และ synchronization
• dynamic diagrams (state, sequence, collaboration activity)
• implementation diagrams(component และ deployment)
– Deployment view : โครงสรางทางกายภาพเกยวกบ การตดต งและใชงานระบบ
• deployment diagram
![Page 38: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/38.jpg)
1. Class Diagrams• Class diagrams
– แสดงรายละเอยดของ Class และความสมพนธระหวาง Class ในมมมองแบบ logical view
• องคประกอบของ UML class diagrams ไดแก– Class, โครงสรางของ Class และพฤตกรรมของ
Class– ตวบงช Multiplicity และ navigation – ชอของ Role– ความสมพนธแบบ Association, aggregation,
dependency, และ inheritance
![Page 39: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/39.jpg)
int x;var x : integer;
X = 5
Offset : 010111011
heap
heap
![Page 40: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/40.jpg)
Classes in UML
Person
Class name
Attributes
Operations
• เขยนได 2 รปแบบ
Person
- TaxIDNo : String- Name : String+ Income : double+ TaxPaid : Boolean
+ calcTax()+ calcTaxBal()
attribute name : type
operation name(parameter : type): result type
![Page 41: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/41.jpg)
อยาไปเอา Type ในภาษาใดภาษาหนงมาใชกบ
UML class diagram
Person
- TaxIDNo : String- Name : String+ Income : real+ TaxPaid : Boolean
+ calcTax()+ calcTaxBal()
Real เปนชนดตวแปรทศนยม ในภาษาปาสคาลเทานน ภาษาอนไมรจก
UML ไมผกตดกบภาษา
Real Pascalfloat,Float c, c++, javadouble,Double c, c++, javaSingle,DoubleVB
Floating,String,Boolean
![Page 42: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/42.jpg)
แสดงผลบนหนาจอ
1. Echo2. Print3. Printf4. Scanf5. System.out.print6. System.out.println7. Write8. Writeln9. Display10. Input11. Read
แตละคาสงคอภาษาอะไร แลวไวทาอะไร
Display “Menu”
![Page 43: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/43.jpg)
ในโลกนมภาษาคอมพวเตอร 160 กวาภาษา
คณรจกแค 2-3 ภาษา
เขยนไดแค 1 ภาษา
เขยนเปน 0 ภาษาจงเขยนโปรแกรม Paintดวยภาษาท ถนด
สรางรป
บนทกได
เปดได
![Page 44: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/44.jpg)
A Class Diagram
Light
off( )on( )
Heater Cooler
Environmental Controller
define_climate( )terminate_climate( )
0..*
1
1
1
1
1SystemLog
display( )recordEvent( )
Actuator
startUp( )shutDown( )
Temperature
generalization
aggregation
![Page 45: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/45.jpg)
Dependency association
Sale & Buy
*
* *
Association class
![Page 46: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/46.jpg)
Television : Product
Product
Computer : Product
TypeAn object
![Page 47: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/47.jpg)
An Object Diagram
Victoria High StreetBranch
(A Branch Object)
London Road Branch
(A Branch Object)
Account#31421123
Account#741421123
Account#521665423
Account#31421123
Account#31421123
Account#714559543
![Page 49: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/49.jpg)
• อาจารย สอน นกศกษา ในรายวชา Association
• อาจารยนฐพงศ สอน นกศกษาไอท 58/2 ในรายวชา OOAD …Senario
นาไปเขยนเปน class diagram
นาไปเขยนเปน objects diagram
![Page 50: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/50.jpg)
• ลกคาไปถอนเงนจากธนาคาร Association
• อาจารยนฐพงศ ถอนเงน 500 บาท จากตธนาคารกสกร …Senario
นาไปเขยนเปน class diagram
นาไปเขยนเปน objects diagram
![Page 51: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/51.jpg)
2. Component Diagram• Component Diagram เปนไดอะแกรมทใชอธบายถง
ซอฟตแวรตางๆ ทเปน Component ของระบบ
![Page 52: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/52.jpg)
A Component Diagram
Course CourseOffering
Student Professor
Course.dll
People.dll
Course
User
Register.exeBilling.exeBillingSystem
อยใน เอกสาร Programmer Manual
![Page 53: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/53.jpg)
2. Component Diagram
WindowHandler(whnd.cpp)
Graphiclib(graphic.dll)
CommHandler(comhnd.cpp)
Main Class(main.cpp)
WindowHandler(whnd.obj)
CommHandler(comhnd.obj)
MainClass(main.obj)
ClilentProgram(client.exe)
component diagram แสดงโครงสรางทางกายภาพของ code ในเทอมของ code components (component อาจเปน source code component, a binary component, or an executable component)
อยใน เอกสาร Programmer Manual
![Page 54: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/54.jpg)
3. Deployment Diagram• Deployment Diagram ใชสาหรบแสดงสถาปตยกรรมของระบบ
ในลกษณะทเปน Physical Architecture คอแสดงวามคอมพวเตอรและอปกรณอะไรบางทตองการใชในระบบ
• ใชรปลกบาศกแทน โดย 1 ลกบาศกจะแทน 1 โหนด และแตละโหนดกจะม component ทเปนองคประกอบของโหนดนน
![Page 55: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/55.jpg)
A Deployment Diagram
AccountServer
DeploysAccountDB.javaAccountMgt.java
AccountServer
AccountMgt.javaAccountDB.java
อยใน เอกสาร Programmer Manualอยใน เอกสาร Programmer Manual
![Page 56: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/56.jpg)
Deployment Diagram
ClientA:Compaq Pro PC
ClientB:Compaq Pro PC
ApplicationServerSilicon GraphicsO2
DatabaseServerVAX
<< DecNe t>>
Deployment diagram แสดงสถาปตยกรรมการตดตงระบบ แสดงการตดตง Hardware และ Software ในระบบ
Client-serverอยใน เอกสาร Programmer Manual
![Page 57: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/57.jpg)
![Page 58: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/58.jpg)
4. Use Case Diagram• Use Case แปลตรงตวมความหมายวา กรณของการใชงานทเกด
จากมมมองของผใชระบบ ตวอยางงายๆ ของ Use Case กคอ - Create Order (ทาการลงใบสงซอสนคา) - Modify Order (ทาการเปลยนแปลงหรอแกไขใบสงซอสนคา) - Delete Order (ทาการลบใบสงซอสนคา)
Use case จะใชในการเกบ Requirement
![Page 59: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/59.jpg)
4. Use Case Diagram• Use Case อาจหมายถง การอธบายฟงกชนการทางาน
ตางๆ ของระบบน นเอง
• Use Case Diagram จะแสดงแผนผงการใชงานของระบบ โดยมองคประกอบ 2 สวนคอ actor และ use case
![Page 60: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/60.jpg)
4. Use case Diagram
แสดงความสามารถหรอพฤตกรรมของระบบทผใชคาดหวง
Actor
Actor (ผใชระบบ)Someone/something ทอยนอกระบบทโตตอบกบระบบ
Use Case name
Use caseชดของการกระทาททาโดยระบบซงให ผลลพธทมคณคาตอผใช
Communicates-Association
Communicates-Associationสายการสอสาร แทนชดการกระทาทงหมด
![Page 61: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/61.jpg)
Use-Case Diagram
Bank Consortium
BankCustomer
Deposit Funds
Withdraw Cash
An Automated Teller Machine (ATM)
Transfer Funds
Cashier
Maintain ATM MaintenanceCrew
Collect Deposits
RTF/LMF
กลมธนาคาร ไดแก
ไทยพานชย ทหารไทย
กรงเทพ ฯลฯ
![Page 62: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/62.jpg)
Use-Case Diagram
Bank Consortium
BankCustomer
Deposit Funds
Withdraw Cash
An Automated Teller Machine (ATM)
Transfer Funds
Cashier
Maintain ATM MaintenanceCrew
Collect Deposits
RTF/LMF
กลมธนาคาร ไดแก
ไทยพานชย ทหารไทย
กรงเทพ ฯลฯ
![Page 63: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/63.jpg)
A Use Case Diagram
Establish Credit
<<include>>
Trader
Validate Client
<<include>>
PlaceOrder
<<extend>>FinancialOfficer
TrackOrder
RetinalScan
CheckPassword
Place RushOrder
StockExchange
<<include>>
Broker Stock
![Page 64: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/64.jpg)
5. Sequence Diagram• Sequence Diagram จะแสดงการทางานของออบเจกต
ตางๆ เมอเกดการสงขาวสารหรอ massage และเมอเกดเหตการณตางๆ โดยทศทางของลกศรจะเปนการบงบอกถงทศทางการสง messageระหวางออบเจกต
![Page 65: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/65.jpg)
A Sequence Diagram
: Student registration form
registration manager math 101
1: fill in info
2: submit
3: add course(joe, math 01)
4: are you open?5: are you open?
6: add (joe)7: add (joe)
math 101 section 1
ถางานใดทเนน ลาดบ เวลา ทากอนหลว หรอ Requirement ใด อะไรทากอน-หลง ให ใช
Sequence Diagram
![Page 66: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/66.jpg)
6. Collaboration Diagram• Collaboration Diagram จะแสดงการตดตอสอสาร
ระหวางออบเจกตตางๆ และความสมพนธระหวางทแตละออบเจกตตดตอสอสารกน
![Page 67: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/67.jpg)
A Collaboration Diagram
: Registrar
course form : CourseForm
theManager : CurriculumManageraCourse :
Course
1: set course info2: process
3: add course
4: new course
เนนท การบรหารจดการ งานใด หรอ Requirement ใด ตองการบรหารจดการ ให ใช
Collaboration Diagram
![Page 68: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/68.jpg)
![Page 69: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/69.jpg)
6. Collaboration Diagram
:aPrinterServer
:aComputer
:aPrinter
:aQueue
1 : Print (file)
[printer busy ]1.2 : Store (file)
[printer free] 1.1 :Print (file)
collaboration diagram แสดงความเกยวพนของ objects ตางๆ ทตองทางานรวมกน
เนนท การบรหารจดการ งานใด หรอ Requirement ใด ตองการบรหารจดการ ให ใช
Collaboration Diagram
กรณ น จะดพรนเตอร วาง หรอไมวาง และ จะจดการอยางไร กใช collaboration diagram
![Page 70: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/70.jpg)
7. State-Transition DiagramState-Transition Diagram ทาหนาทตอไปน• แสดงวงจรชวตของออบเจกต ระบบยอยตางๆ และระบบ
โดยรวม• บงบอกวาเหตการณตางๆ จะสงผลกระทบใหเกดอะไรขน
บางในระบบ• อาจมจดเร มตนและและจดจบไดหลายจด
![Page 71: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/71.jpg)
A State-Transition Diagram
Initialization Openentry: Register studentexit: Increment count
Closed
Canceled
do: Initialize course
do: Finalize coursedo: Notify registered students
Add Student / Set count = 0
Add student[ count < 10 ]
[ count = 10 ]
Cancel
Cancel
Cancel
![Page 72: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/72.jpg)
State Diagram
go up(floor)
go up(floor)
On first floor
Moving to firstfloor
Arrive at first floor
MovingUp
Movingdown Idle
Arrive at floor
go down(floor)
state diagram แสดงสถาณภาพ (state) ทเปนไปไดของ object ใดๆ รวมทงแสดงเหตการณ (event) ททาใหเกดการเปลยนสภาพของ object
![Page 73: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/73.jpg)
• ใชสาหรบ– อธบาย กระแสการไหลของการทางาน (workflow)– แสดงขนตอนการทางานของระบบ
• แตละขนตอนการทางาน เรยกวา Activity ตวอยาง ไดแก– การคานวณผลลพธบางอยาง– การเปลยนแปลงสถานะ (State) ของระบบ– การสงคากลบคน – การสงสญญาณ– การเรยกใหโอเปอรเรชนอนๆ ทางาน– การสราง หรอ ทาลายวตถ
8. Activity diagramFlowchart in traditional approaches
![Page 74: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/74.jpg)
Activity Diagramactivity diagram แสดงลาดบกระแสของกจกรรมของการทางานใดๆเชน ขนตอนการทา operation ขนตอนการลงทะเบยน
Initial State
Final State
ActionState1 Action State
Transition (Fork)
Transition (Join)
Control Flow
Decision
Partition1
Swimlane
Note
ActionState1
![Page 75: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/75.jpg)
ตย. Activity Diagram แสดงการทางานของ operation ‘print’
ShowMessageBox“Disk full” on screen
ShowMessageBox“Printing” on screen
Create postscriptfile
RomoveMessageBox
^Printer.Print(file)
PrintFile()
[disk full]
[free disk space]
![Page 76: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/76.jpg)
ต.ย. Activity Diagram แสดงการโครงการสานกทางหลวงพเศษระหวางเมองผรบจาง
สารวจขอมล/ ศกษาวเคราะหการลงบญชในปจจบน
ทบทวน/ตรวจสอบรายงาน
ออกแบบงานบญช
ออกแบบระบบสารสนเทศ
ทบทวน/ตรวจสอบรายงาน
พฒนาระบบสารสนเทศฐานขอมลบญช
ทดสอบระบบ
ทารายงานฉบบสมบรณ
ตรวจรบระบบ
![Page 77: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/77.jpg)
An Activity DiagramShow
MessageBox“Printing” on Screen
Create postscriptfile
Send postscriptfile to printer
RemoveMessageBox
displayer samplerSwimlane Example
Ordinary Example
![Page 78: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/78.jpg)
Class
Attributes
Operations
Node
Use Case
Object
Attributes
Operations
State
Interface
Component
NotePackage
Model Elements
![Page 79: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/79.jpg)
Aggregation ( a form of Association)
Association
Generalization
Dependency
![Page 80: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/80.jpg)
General Mechanisms
เครองประดบ (Adornments)
UML มกลไกสาหรบการให information เพมเตมเขาไปในทกประเภทของแผนภาพ โดยเฉพาะ information น นไมสามารถสอสารไดโดยใชสญลกษณพนฐานของ UML ทม
โนต (Notes)
ขอกาหนด (Specifications)
Extensibility Mechanism
แมพมพ (Stereotypes)
ตดปาย (Tagged value)
ขอจากด (Constraints)
![Page 81: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/81.jpg)
Adornments เพม information เขาไปในสญลกษณปกต
Stock Option
TheorPrice( )MarketPrice( )ExpireDate ( )
Using Black &Schole Formula
A note contains any additional information such as a simple comment
Stock Option
+TheorPrice( )#MarketPrice( )-ExpireDate ( )
![Page 82: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/82.jpg)
<<Actor>>Customer
Customer
Customer
The customer is a class with the stereotype <<Actor>>. The stereotype adds extra semantics to the class; in this case, that the class represents an external user of the system
![Page 83: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/83.jpg)
Instrument{abstract}{author = “HEE”}{status = draft }
Value : intexpdate : Date
Properties on an Instrument class. Abstract is a predefined property; author and status are user defines tagged values
![Page 84: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/84.jpg)
SeniorCitizenGroup
{person.age > 60}
A constraint restricts which Person objects may participate in the association
Person
0..1
0..*
![Page 85: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/85.jpg)
Benefits of UML• เปนภาษามาตรฐานทใชในการสรางแบบจาลองเชงวตถ โดยใช
รปภาพ (Standard Visual Modeling Language)• ใชในการแลกเปลยนขอมล แบบจาลองกนระหวางทมผพฒนา
และระหวางผใช กบทมผพฒนา• นาเสนอ และ สนบสนนหลกการเชงวตถไดครบถวน ชดเจน• ไมผกตดกบภาษาโปรแกรม (Programming Language)
ภาษาใดภาษาหนง• สนบสนนการขยายขอบเขต และการปรบปรงระบบ โดยทไม
จาเปนตองลงมอพฒนาซอสโคดกอน
![Page 86: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/86.jpg)
Use Case Model
![Page 87: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/87.jpg)
System Analysis• กระบวนการวเคราะหระบบ (system analysis phase)
– มงเนน “what” ทระบบจะตองม และตองทาใหกบผใช ไมเนน “how” วาจะทาอยางไร
• กระบวนการวเคราะหความตองการของผใชระบบ (Requirement analysis phase)– ใชในการสรางแบบจาลองหนาทการทางานของระบบ
ซอฟตแวร จากมมมองของผใชภายนอก หรอ ระบบภายนอก
– ไดแบบจาลองของความตองการของผใชระบบ (Requirement Model) เปน Output
![Page 88: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/88.jpg)
System Analysis and Use Case• Use Case Model
– Use Case Model คอแบบจาลองความตองการของระบบ ท นาเสนอ functional requirement ของระบบโดยรวม จากมมมองของผใชภายนอก หรอ ระบบภายนอก
– โดยจะทาหนาทในการระบพฤตกรรม หรอหนาทการทางานของระบบ (เนน “what”) ทระบบตองม
– ใชในการทดสอบ และตรวจสอบ โครงสราง และหนาทการทางานของระบบ
– ใน UML ระบเปน Use Case Description (Text) หรอ Use Case Diagram (Diagram)
![Page 89: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/89.jpg)
Use Case Example• Name: การสงรายการซอขายหลกทรพย (Place Order)
– Main flow of events:1. Trader ปอนชอ และรหสของ client2. System ตรวจสอบ (Validate) ชอ รหส และ credit ของ
client3. Trader ปอนรหสหลกทรพย จานวนหลกทรพย และราคา
หลกทรพย ท Client ตองการซอขาย4. System ตรวจสอบเงอนไขราคาของหลกทรพย6. System สง order ใหกบตลาดหลกทรพย7. System เกบหมายเลข order ทไดรบจากตลาด
หลกทรพย8. System แจงให Trader ทราบ
Trader
Place OrderStock
Exchange Market
![Page 90: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/90.jpg)
Use Case Diagram• นาเสนอ Use Case และการปฏสมพนธโตตอบกน
ระหวางระบบ และ ผใชภายนอก (อาจเปนคน หรอระบบกได)
• ประกอบดวย– Use Case - ความสามารถ/หนาทของระบบ– Actor - ผกระทา/ผใชงาน Use Case น นๆ– Relationship - เสนแสดงความสมพนธระหวาง
Use Case กบ Actor– System - ระบบทกาลงพฒนา
![Page 91: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/91.jpg)
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 92: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/92.jpg)
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 93: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/93.jpg)
Construct Description Syntax
include An relationship from a base use caseto an inclusion use case, specifyinghow the behavior for the inclusion usecase is inserted into the behaviordefined for the base use case.
Use Case Modeling : Core Relationships (cont’d)
<<include>>
![Page 94: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/94.jpg)
Use Cases v.s. Scenario
• Use Case– ความสามารถ หรอ หนาทการทางานของระบบ– แตละ Use Case แทนชดของ transactions ทระบบทางาน
โตตอบกบ ผใชงาน หรอระบบอนๆ ภายนอก• Scenario
– สถานการณ หรอตวอยางเรองราวการใชงานระบบ– Scenario จดเปน instance ของ use case– เชน
withdrawal cash
a user withdrawals$200
![Page 95: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/95.jpg)
Actors• Actor หมายถง someone หรอ some thing ทมการ
ปฏสมพนธ โตตอบกบระบบ– สงใดกตามทมความตองการในการแลกเปลยน
information กบระบบ หรอ สงใดกตามทอยภายนอกระบบ และมการใชงาน Use Case ของระบบ
– กาหนดบทบาทหนาทของผใชระบบ– กาหนดการเชอมโยงกบระบบอนๆ ภายนอก
• ตวอยางของ Actors– Customer -- maintain their account– Cashier -- verify withdrawal amount
Customer Cashier
![Page 96: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/96.jpg)
Actors• Actors สามารถอธบายโดยใช Specialization
Relationship
• อาจพจารณา Actors เปนคลาส ใน UML เนองจากมrelationships เชนเดยวกบทคลาสม
specialization relationship
Customer
ATM Customer Cashier Customer
![Page 97: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/97.jpg)
Actors• เชอมตอกบ use cases โดยใชเสนแสดงความ
เกยวของ ปฏสมพนธ(association)• association = ความสมพนธท มการตดตอสอสารกน
(ท งการรบ และสง messages ใหแกกนและกน)
• ใช generalization relationships อธบายความสมพนธ ระหวาง actors ไมจาเปนตองอธบายรายละเอยดของ Association เนองจากไมมการ Implement สวนของ Actor ในระบบ
Customerwithdrawal cash
![Page 98: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/98.jpg)
System• System
– อาจหมายถง Software system, business, hardware,..
– วตถประสงคใน use-case modeling เพอระบขอบเขตของระบบทกาลงพฒนา (system boundary)
• ใชสญลกษณ
System
![Page 99: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/99.jpg)
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 100: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/100.jpg)
Generalization Relationship• Child Use case รบถายทอด
คณสมบตมาจาก Parent Use Case
• Child สามารถเปลยนแปลงพฤตกรรมทรบจาก Parent หรอเพมเต มพฤตกรรม
• Child อาจนาไปแทนท ในทๆ Parent ปรากฏ
Validate client
Check password
Retinal scan
![Page 101: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/101.jpg)
“Include” relationship• มกใชในการหลกเลยงการอธบายการไหลของ
เหตการณ (flow of events) เดม ซากนหลายๆ คร ง โดยรวบรวมพฤตกรรมรวม ใน Use Case
• หลกเลยงการ copy & paste ของ Use Case Descriptions
Validate clientPlace
order
<<include>>
Track order
<<include>>
![Page 102: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/102.jpg)
“Include” Example• Name : การตรวจสอบรายการซอขายหลกทรพย
(Track Order) – Main flow:
1. ใชหมายเลข order ในการตรวจสอบ ทไดรบจากตลาดหลกทรพย Obtain and verify order number
2. Include สวนของ “Validate client”3. ในแตละสวนของ Order …
Track Order ValidateClient
<<include>>
![Page 103: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/103.jpg)
“Extend” relationship
• ใชสรางแบบจาลองบางสวนของ Use Case ท user อาจมองเปน optional
• ใช สรางแบบจาลอง conditional subflows
• ใชในการแทรก subflows ในจดทระบโดยพจารณา ปฏสมพนธระหวาง Actors
<<extend>>(set priority)
Place orderExtension points:
Set priority
Place rush order
![Page 104: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/104.jpg)
“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>>
![Page 105: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/105.jpg)
Relationships between Use Case
WithdrawalCash
ValidateAccount
<<include>>
Ship PartialOrder
Ship Order
<<extend>>
![Page 106: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/106.jpg)
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 107: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/107.jpg)
A Use Case Diagram
Establish
Credit
<<include>>
Trader
Validate Client
<<include>>
PlaceOrder
<<extend>>FinancialOfficer
TrackOrder
RetinalScan
CheckPassword
Place RushOrder
StockExchange
<<include>>
![Page 108: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/108.jpg)
A Use Case Diagram
<<include>>
Customer
Validate Account
<<include>>
BankTeller
Deposit
BalanceChecking
Transfer
Withdraw
Verifywithdrawal
<<include>>
![Page 109: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/109.jpg)
When and how?• Requirements capture
– ใชในการกาหนด Reuqirement ของระบบ– สรางแบบจาลอง (Model) ของ User requirements
ดวย Use Case• Test Scenarios
– สรางแบบจาลอง (Model) ของสถานการณการทดสอบระบบ (test scenarios) ดวย Use Case
• Use Case: ระบส งท customer ตองการใหมในระบบ– ต งชอให Use Case– เขยนคาอธบายส นๆ– เพมรายละเอยดในภายหลง
![Page 110: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/110.jpg)
Finding Actors• สามารถระบ actor ไดโดยตอบคาถามตอไปน
– ใครเปนคนใชงานหนาทการทางานหลกของระบบ (primary actors)?– ใครตองการการสนบสนนการทางานจากระบบ?– ใครตองการบารงรกษา และบรหารระบบ (secondary actors)?– Hardware devices ใดทตองการใหระบบจดการดแล?– ระบบภายนอกระบบใดท ตองการใหระบบมปฏสมพนธดวย?– ใคร หรอ อะไรทตองการไดรบผลประโยชน จาก output ของระบบ?
• Tips– ไมควรพจารณาเฉพาะ users ทใชงานระบบโดยตรง แต พจารณา
users อนๆ ทตองการใชบรการจากระบบดวย
![Page 111: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/111.jpg)
Finding Use Cases• สาหรบแตละ actor ตอบคาถามตอไปน
– หนาทการทางานอะไรท actor ตองการจากระบบ?– ขอมลใดบางท actor ตองการสราง อาน ลบ เปลยนแปลง หรอเกบอย
ภายในระบบ?– เหตการณใดบางทระบบตองแจงให actor ทราบ? หรอ actor ตอง
แจงใหระบบทราบ? – หนาทการทางานของระบบ ชวยทาใหงานประจาวนของ actor งาย
ขนหรอไม?• ถาไมพจารณา actors
– อะไรคอ input/output ของระบบ ? input/output เหลาน นมาจากไหน หรอใครเปนคนนาไปใชงาน?
– ปญหาหลกของระบบทใชงานอย คออะไร?
![Page 112: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/112.jpg)
Recipe (เทคนค)• ระบ actors ทมปฏสมพนธกบระบบ• พจารณาแนวทางของระบบ ในการปฏสมพนธกบ
actors• จาแนกพฤตกรรมของระบบใน การปฏสมพนธกบ
actors ใหเปน use cases โดยกาหนดความสมพนธระหวาง Use Case
![Page 113: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/113.jpg)
ตวอยางการเขยน Use case
![Page 114: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/114.jpg)
การเขยน Use caseองคประกอบมดงน- ชอของ Use Case- ภาพรวมของการทางาน (Overview)- Actor หลก (Primary Actor)- Actor รอง (Secondary Actor)- จดเร มตน (Starting Point)-จดสนสด (End point)- การทางานของ Use Case (Flow of Events)- การทางานของ Use Case เมอมปญหาเกดขน
(Alternative flow of Events)-ผลของการทางานของ Use Case (Measurable
Result)
![Page 115: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/115.jpg)
Use Case : Create Orderภาพรวมของการทางาน (Overview)
จดประสงคหลกของ Use Case น เพอทาการลงขอมลในใบสงซอสนคาจากลกคา
Actor หลก (Primary Actor)ตวแทนฝายขายสนคา
Actor รอง (Secondary Actor)ไมม
จดเร มตน (Starting Point)Use Case ตวนเรมตนเมอ Actor ตวแทนฝายขายสนคาขอให ระบบทาการลงขอมลการสงซอสนคา
จดสนสด (End point)คาขอเพอทาการลงขอมลการสงซอสนคาเสรจสนสมบรณหรอไมกถกยกเลก
![Page 116: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/116.jpg)
Use Case : Create Orderการทางานของ Use Case (Flow of Events)
จาก User Interface บนจอเพอทาการลงขอมลการสงซอ Actor จะตองทาการใสขอมลเกยวกบการสงซอ เปนตนวา วนทลกคาตองการใหสนคาสงมอบถงมอ (Required Date) ปรมาณทตองการส งซอ (Quantity) ตองการใหสงมอบสนคาโดยบรษทสงสนคาไหน (ShipVia) ตองการใหใหสงมอบสนคาทไหน (ShipAddress) หลงจากนนแลว Actor สามารถเลอกทจะทาการบนทกขอมลลงไปไวในฐานขอมล หรอยกเลกการทางานทงหมด ถา Actor เลอกทาการบนทก ใบสงซอใบใหมกจะถกสรางขนมาในฐานขอมล
![Page 117: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/117.jpg)
Use Case : Create Orderการทางานของ Use Case เมอมปญหาเกดขน
(Alternative Flow of Events)ถาไมมสนคาทตองการอยในคลงสนคา ระบบจะตองแจงให Actor ทราบพรอมกนนนกตองยกเลกการทางานทเหลอของUse Case น
ผลของการทางานของ Use Case (Measurable Result)จะมใบสงซอสนคาใหม 1 ใบขนมาในระบบ
![Page 118: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/118.jpg)
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 119: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/119.jpg)
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 to
purchase. 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 120: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/120.jpg)
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 EVENTSACTOR ACTION SYSTEM RESPONSE
![Page 121: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/121.jpg)
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 122: Last Update : 14/12/2560siam2dev.net/E_Learning/OOAD/Lec05_OOAD_UML_v2015_Last_update_14_12_2560_PDF.pdfการวิเคราะห์และออกแบบระบบเชงวัตถุ](https://reader033.fdocument.pub/reader033/viewer/2022041623/5e4051a3c55e1100ca3ac190/html5/thumbnails/122.jpg)
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