the unified modelling lanage (uml)
TRANSCRIPT
![Page 1: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/1.jpg)
The Unified Modelling Language (UML)
อาจารย์สมเกียรติ ช่อเหมือน ([email protected])สาขาวิชาวิศวกรรมซอฟต์แวร์ คณะวิทยาศาสตร์และเทคโนโลยี
![Page 2: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/2.jpg)
The Unified Modelling Language (UML)
• An introduction to UMLUML Class DiagramsUML SyntaxUML Package DiagramsUML Object diagramsUML Sequence Diagrams
![Page 3: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/3.jpg)
UML (Unified Modelling Language)
• การสร้างแบบจ าลองซอฟต์แวร์ ในรูปของสัญลักษณ์ • เพื่อใช้ในการอธิบายระเบียบวิธีการ • เข้าใจล าดับขั้นตอนในการท างานให้บรรลุผล• จัดล าดับของกิจกรรมเพื่อรวบรวมความต้องการของผู้ใช้• กระบวนการเขียน Diagram โดยใช้ สัญลักษณ์ในการออกแบบซอฟต์แวร์
น าเสนอ และตกลงร่วมกัน• ใช้แผนภาพประกอบเพื่อช่วยให้เข้าใจได้ง่าย และอธิบายข้อมูลทางเทคนิคให้
ถูกต้องตรงกันและชัดเจนขึ้น• น าไปใช้ในกระบวนต่อไปของการพัฒนาซอฟต์แวร์ได้• ไม่ใช้วิธีการ แต่เป็นสิ่งที่น าไปใช้ช่วยให้สามารถออกแบบและน าไปใช้ไดอ้ย่าง
ถูกต้อง ด้วยการสร้างแผนภาพ เพื่อเป็นแนวทางที่เหมาะสมตามความต้องการ
![Page 4: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/4.jpg)
Class diagrams
• แผนภาพพ้ืนฐานของแนวคิดเชิงวัตถุ
• แสดงรายละเอียดของสิ่งต่างๆ
• แสดงความเกี่ยวข้องของสิ่งต่างๆ
• แสดงสถาปัตยกรรมของระบบ
![Page 5: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/5.jpg)
Class diagrams
• Class ชั้นประกอบด้วย– ชื่อไม่ซ้ ากัน (*ขึ้นต้นด้วยตัวพิมพ์ใหญ)่– รายการแอตทริบิวต์– รายการของวิธีการ
• การมองเห็นและการเข้าถึงจากภายนอก (visibility modifiers)– private Attributes– public methods
• ทราบถึงข้อมูลที่สนใจและสามารถตัดสว่นที่ไม่สนใจออกได้• บาง Class จะเรียกใช้งาน Classอื่น ๆ • ความสัมพันธ์เหล่านี้จะแสดงโดยลูกศร
![Page 6: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/6.jpg)
Class diagrams
• Classes– - attributes– - operations– - visibility
• Relationships– - navigability– - multiplicity– - dependency– - aggregation– - composition
• Generalization / specialization– - inheritance– - interfaces
• Keywords• Notes and Comments
![Page 7: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/7.jpg)
UML Syntax
• Visibility‘+’ public
‘-’ private
‘#’ protected
‘~’ package
• Multiplicity is one‘n’ exactly n
‘*’ zero or more
‘m..‘n’ between m and n
![Page 8: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/8.jpg)
UML Syntax
• Visibility‘+’ public
‘-’ private
‘#’ protected
‘~’ package
• Multiplicity is one‘n’ exactly n
‘*’ zero or more
‘m..‘n’ between m and n
![Page 9: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/9.jpg)
Examples of attributes
• visibility name (par1 : type1, par2 : type2): returntype
- custRef : int [1]
# itemCodes : String [1..*]
validCard : boolean
![Page 10: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/10.jpg)
Examples of method
• + addName (newName : String) : boolean
![Page 11: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/11.jpg)
relationships between classes
• ‘Association’
multiplicity
‘source’ class points to the ‘target’
![Page 12: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/12.jpg)
Relationships between classes
• The diagram below shows this information
• All class names begin in uppercase• attribute and method names begin in lowercase.
• class ItemForSale describes a single item• ‘listOfItems’ list of zero or more individual objects
![Page 13: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/13.jpg)
Types of Association
• Dependency
• Simple association
• Bidirectional association
• Aggregation and
• Composition
![Page 14: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/14.jpg)
Inheritance
การ คลาส A สืบทอดมาจากคลาส B
![Page 15: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/15.jpg)
Interfaces
• implemented by Publication• required by CashTill
<<realizes>>
“ball and socket” in UML2
![Page 16: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/16.jpg)
Notes
![Page 17: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/17.jpg)
elements of UML Class Diagram notation
![Page 18: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/18.jpg)
elements of UML Class Diagram notation
![Page 19: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/19.jpg)
Package Diagrams
![Page 20: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/20.jpg)
Package Naming
• package names are normally in lowercase• local individual projects packages
– Mysystem– mysystem.interface– mysystem.engine– mysystem.engine.util– mysystem.database
• based on URL
![Page 21: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/21.jpg)
Package Diagram
• Dependency arrows have been drawn to highlight relationships betweenpackages. When more thought has been put into determining these relationships theymay turn out to be associations
![Page 22: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/22.jpg)
UML Object Diagrams
• objectName : ClassName
• attribute = value
![Page 23: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/23.jpg)
Sequence Diagrams
actions taking place
![Page 24: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/24.jpg)
Sequence Diagrams
• Selection and Iteration– The logic of a scenario often depends on selection (‘if’) and
iteration (loops).– There is a notation (‘interaction frames’) which allow ifs and
loops to be represented in sequencediagrams however these tend to make the diagrams cluttered.
– Sequence diagrams are generally best used for illustrating particular cases, with the full refinement reserved for the implementation code.
![Page 25: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/25.jpg)
UML notation (สัญลักษณ์)
![Page 26: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/26.jpg)
UML
![Page 27: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/27.jpg)
https://www.google.co.th/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwi-wsj0kqbLAhXHCo4KHRWzDdcQjRwIBw&url=http%3A%2F%2Fwww.sedris.org%2Fdm_notn.htm&psig=AFQjCNHYZn1cgpz8DvGn-gXSSomANAKAPQ&ust=1457150162826343
![Page 28: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/28.jpg)
สัญลักษณ์ที่ใช้ในการเขียน UML
![Page 29: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/29.jpg)
UML class-object
Elephant
e1 e2
UML
new
![Page 30: The Unified Modelling Lanage (UML)](https://reader034.vdocuments.net/reader034/viewer/2022042707/58d0cebb1a28ab866c8b6b23/html5/thumbnails/30.jpg)
สรุป
• UML เป็นภาษาที่ใช้ก าหนดรายละเอียดโดยใช้โมเดลด้านซอฟต์แวร์ เพื่อช่วยให้สามารถท างานร่วมกันได้ โดยยึดรูปแบบที่วิเคราะห์และออกแบบไว้ร่วมกัน
• แผนภาพแต่ละชนิดใช้ส าหรับแสดงรายละเอียดของซอฟต์แวร์แตกต่างกัน ท าให้สามารถเข้าใจโครงสร้างและสถาปัตยกรรมในการพัฒนาซอฟต์แวร์ได้
• สัญลักษณ์ที่น ามาใช้เป็นมาตรฐานเดียวกันในการวิเคราะห์และออกแบบเชิงวัตถุ