[OCUP課程重點-3]Class Diagram(進階)
進階Class Diagram
- Class Name斜體字為抽象類別或利用{abstract} –>constraint
- 不會有instance
- 限制constraint
- 擺在{}裡
- /代表衍生屬性
- 例如TotalPirce,可以由單價與數量兩個屬性計算出來
- 兩個Class之間可能有多個關係
- 例如Element與Comment有association與composication
- Element介紹
- Element
- A element is a constituent of a model. As such, it ahs the capability of owning other elements
- Relationship
- Relationship is an abstract concept that specifies some kind of relationship between elements
- 例如association
- DirectedRelationship
- 具方向性的關係,有source與target
- 例如 generation
- 例如dependency
- 具方向性的關係,有source與target
- Comment
- A comment is a textual annotation that can be attached to a set of elements
- 虛線可以被隱藏
- NameSpace
- A namespace is an element in a model that contains a set of named elements that can be identified by name
- 由PackageImport、ElementImport與NamedElement組合
- NamedElement
- 可透過名稱來識別元素
- comment不是NamedElement
- qualified name限定名稱
- 同一個namespace中,不能有兩個同名的具名元素,否則無法識別
- 把完整的namespace寫清楚,來識別為兩個不同的namedElement
- VisibilityKind
- 列舉型別
- Public
- Private
- Protected
- Package
- 列舉型別
- Packageable Element
- A packageable elment indicattes a named element that may be owned directly by a package
- Element Import
- 一種具向關係,透過它可以將套件內的任一元素,匯入到另一個名稱空間
- import後可以直呼其名,而不需使用qualified name
- ElementImport有個屬性alias,PackageImport沒有
- ElementImport可以取別名
- ElementImport
- Public
- Imports
- Private
- Access
- 類似Once,僅能被呼叫Access的namespace看到
- Access
- Public
- 個體數目
- MultiplicityElement
- A multiplicity is a definition of an inclusive interval of non-negative integers beginning with a lower bound and ending with a (possibly infinite) upper bound. A multiplicity element embeds this information to specify the allowable cardinalities for an instantiation of this element
- {Order}
- 預設為false
- {Unique}
- 預設為True
- 相同意義不同表示
- Type
- Expression
- LiteralSpecification
- 原生型別
- String
- Integer
- Boolean
- UnlimitedNatural
- *
- 原生型別
- LiteralSpecification
- Instance Value
- object裡的屬性與值
- Constraint
- 任何元素都可以放置限制條件
- 一個限制可以同時限制多個元素
- 放在大括號{}內
- 多個元素同一個限制可用虛線關聯
- MultiplicityElement
- Slot
- A slot specifies that an entity modeled by an instance specification has a value or values for a specific structural feature.
- RedifinableElement
- attribute有底線屬於static
- static為classifier等級的feature
- 參數方向列舉 ParameterDirectionKind
- in
- out
- inout
- return
- DataType
- 沒有identified
- instance是Value
- Permission
- 許可關係,private可以被存取
- 類似Package裡的Access,無法被遞移
- 許可關係,private可以被存取
- Useage
- 依賴關係-實作
- Abstraction
- 相同概念呈現出不同的抽象層次
- Element
blog 與課程更新內容,請前往新站位置:http://tdd.best/