クラス図
検討対象のプログラム中に、どんなクラスが存在するのか、 また、クラスとクラスの間にどんな関係があるのかを図示する
クラス図を作成することで、プログラム内の変数の過不足や、 変数が所属するクラスの妥当性を検討できる
https://plantuml-proxy.vercel.app/svg/https://scrapbox.io/api/code/suto3/クラス図/class.uml#.svg
code:class.uml
@startuml
header some header
footer some footer
title My title
caption This is caption
legend
The legend
end legend
a -- b
@enduml
矢印での関連性の意味
code:c.mermaid
classDiagram
note "From Duck till Zebra"
Animal <|-- Duck
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}