[OCUP課程重點-3]Class Diagram(進階)

  • 14997
  • 0

[OCUP課程重點-3]Class Diagram(進階)

進階Class Diagram

  1. Class Name斜體字為抽象類別或利用{abstract} –>constraint
    • 不會有instance
  2. 限制constraint
    • 擺在{}裡
  3. /代表衍生屬性
    • 例如TotalPirce,可以由單價與數量兩個屬性計算出來
  4. 兩個Class之間可能有多個關係
    • 例如Element與Comment有association與composication
  5. Element介紹
    1. Element
      • A element is a constituent of a model. As such, it ahs the capability of owning other elements
    2. Relationship
      • Relationship is an abstract concept that specifies some kind of relationship between elements
      • 例如association
    3. DirectedRelationship
      • 具方向性的關係,有source與target
        • 例如 generation
        • 例如dependency
    4. Comment
      • A comment is a textual annotation that can be attached to a set of elements
      • 虛線可以被隱藏
    5. NameSpace
      1. A namespace is an element in a model that contains a set of named elements that can be identified by name
      2. 由PackageImport、ElementImport與NamedElement組合
      3. NamedElement
        • 可透過名稱來識別元素
        • comment不是NamedElement
      4. qualified name限定名稱
        • 同一個namespace中,不能有兩個同名的具名元素,否則無法識別
        • 把完整的namespace寫清楚,來識別為兩個不同的namedElement
      5. VisibilityKind
        • 列舉型別
          • Public
          • Private
          • Protected
          • Package
      6. Packageable Element
        • A packageable elment indicattes a named element that may be owned directly by a package
      7. Element Import
        • 一種具向關係,透過它可以將套件內的任一元素,匯入到另一個名稱空間
        • import後可以直呼其名,而不需使用qualified name
        • ElementImport有個屬性alias,PackageImport沒有
          • ElementImport可以取別名
        • ElementImport
          • Public
            • Imports
          • Private
            • Access
              • 類似Once,僅能被呼叫Access的namespace看到
      8. 個體數目
        1. 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
          • 相同意義不同表示
            • 個體數目表示1
            • 個體數目表示2
        2. Type
        3. Expression
          • LiteralSpecification
            • 原生型別
              1. String
              2. Integer
              3. Boolean
              4. UnlimitedNatural
                • *
        4. Instance Value
          • object裡的屬性與值
        5. Constraint
          • 任何元素都可以放置限制條件
          • 一個限制可以同時限制多個元素
          • 放在大括號{}內
          • 多個元素同一個限制可用虛線關聯
      9. Slot
        • A slot specifies that an entity modeled by an instance specification has a value or values for a specific structural feature.
      10. RedifinableElement
        • 可被覆寫的
        • RedifinableElement 
      11. attribute有底線屬於static
        • static為classifier等級的feature
      12. 參數方向列舉 ParameterDirectionKind
        1. in
        2. out
        3. inout
        4. return
    6. DataType
      • 沒有identified
      • instance是Value
    7. Permission
      • 許可關係,private可以被存取
        • 類似Package裡的Access,無法被遞移
    8. Useage
      • 依賴關係-實作
    9. Abstraction
      • 相同概念呈現出不同的抽象層次

blog 與課程更新內容,請前往新站位置:http://tdd.best/