1. The Unified Modelling Language (UML)
อาจารย์สมเกียรติ ช่อเหมือน (tkorinp@hotmail.com)
สาขาวิชาวิศวกรรมซอฟต์แวร์ คณะวิทยาศาสตร์และเทคโนโลยี
2. The Unified Modelling Language (UML)
• An introduction to UML
UML Class Diagrams
UML Syntax
UML Package Diagrams
UML Object diagrams
UML Sequence Diagrams
7. UML Syntax
• Visibility
‘+’ public
‘-’ private
‘#’ protected
‘~’ package
• Multiplicity is one
‘n’ exactly n
‘*’ zero or more
‘m..‘n’ between m and n
8. UML Syntax
• Visibility
‘+’ public
‘-’ private
‘#’ protected
‘~’ package
• Multiplicity is one
‘n’ exactly n
‘*’ zero or more
‘m..‘n’ between m and n
9. Examples of attributes
• visibility name (par1 : type1, par2 : type2): returntype
- custRef : int [1]
# itemCodes : String [1..*]
validCard : boolean
12. 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
13. Types of Association
• Dependency
• Simple association
• Bidirectional association
• Aggregation and
• Composition
20. 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
21. Package Diagram
• Dependency arrows have been drawn to highlight relationships between
packages. When more thought has been put into determining these relationships they
may turn out to be associations
24. 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 sequence
diagrams 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.