plantUML關係畫圖方法

繼承關係 實現關係 依賴關係 關聯關係 聚合關係 組合關係
方法參數引用 屬性關聯 多屬性關聯 單屬性關聯
三角實線 三角虛線 箭頭虛線 箭頭實線 空棱形實線箭頭 實棱形實線箭頭
<|– <|… <… <– o– *–
@startuml
class ImageLoader{
    loadImage(ImageInfo)
}

class ImageInfo{
}

ImageInfo <.. ImageLoader :依賴關係

class Window {
-WindowManager mWindowManager
}

class WindowManager

WindowManager <-- Window:關聯關係

class Company
class Department
Company o-- Department:聚合關係

class Bird
class Wing
Bird *-- Wing:組合關係

abstract class Factory
class PhoneFactory
class CarFactory
Factory <|-- PhoneFactory:泛化關係
Factory <|-- CarFactory:也就是繼承關係

interface IColorDraw{
    draw()
}
class RedColorDraw{
    draw()
}
class BlueColorDraw{
    draw()
}
IColorDraw <|.. RedColorDraw:實現關係
IColorDraw <|.. BlueColorDraw:實現某個接口
@enduml
``

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章