Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ふんわり使うPlantUML
Search
Norio Suzuki
March 24, 2023
Programming
0
970
ふんわり使うPlantUML
PlantUML を使って、ふんわりと図を描くはなし。
PHPerKaigi 2023 (2023-03-24)
https://phperkaigi.jp/2023/
Norio Suzuki
March 24, 2023
Tweet
Share
More Decks by Norio Suzuki
See All by Norio Suzuki
リーダブル プルリクエスト 分割プルリクエスト編 / Readable Pull Request
suzuki
3
1.2k
Symfony Serializer Deep Dive
suzuki
0
2k
How to walk in the Crowi
suzuki
6
15k
Swift Mailer Update
suzuki
2
2.3k
Guzzle Promiseを使った 非同期処理によるAPIコールの高速化
suzuki
15
16k
PHP BLT #4
suzuki
1
4.6k
Learning Swift2 with PHP7
suzuki
2
4.1k
ポモドーロ・テクニック入門の入門
suzuki
0
650
Automatically run the JavaScript test in multiple browsers
suzuki
5
6.1k
Other Decks in Programming
See All in Programming
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.1k
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Server Driven Compose With Firebase
skydoves
0
400
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
350
CSC509 Lecture 09
javiergs
PRO
0
100
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
7
2.8k
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
110
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.7k
Realtime API 入門
riofujimon
0
110
Java ジェネリクス入門 2024
nagise
0
600
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
4
1.5k
macOS でできる リアルタイム動画像処理
biacco42
6
1.7k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Docker and Python
trallard
40
3.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Bash Introduction
62gerente
608
210k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
How to Think Like a Performance Engineer
csswizardry
19
1.1k
Designing Experiences People Love
moore
138
23k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Transcript
!TV[VLJ ;ΜΘΓ͏1MBOU6.- 1)1FS,BJHJ
͢͜ͱ w ʮ;ΜΘΓ͏ʯͷఆٛ w 1MBOU6.-ͷ͍ํɾֶͼํ w Θͨ͠ͷ͍ํ w ͓·͚
͞ͳ͍͜ͱ w 6.-ͦͷͷʹ͍ͭͯͷৄࡉ w ଞͷπʔϧͱͷൺֱ
"CPVUNF
!TV[VLJ IUUQTUXJUUFSDPNTV[VLJ IUUQTHJUIVCDPNTV[VLJ IUUQTTQFBLFSEFDLDPNTV[VLJ
$VSSFOUMZXPSLFEBU3"#0 *OD IUUQTSBCPDBU
1MBOU6.-Λʮ;ΜΘΓ͏ʯ
w ςΩετͰهड़͠ɺਤΛඳͨ͘Ίͷπʔϧ w 6.-Λத৺ͱͨ͠ଟ࠼ͳਤΛαϙʔτ w ςΩετϑΝΠϧͳͷͰཤྺཧָ͕ 1MBOU6.-ͱ IUUQTQMBOUVNMDPN
౷ҰϞσϦϯάݴޠ lΦϒδΣΫτࢦͷΤοηϯεΛத৺ʹɺ ඪ४తͳਤͷॻ͖ํΛܾΊͯɺͭ·Βͳ͍ ޡղΛආ͚ΔΑ͏ʹͨ͠ͷ͕6.- ʢ6OJ fi FE.PEFMJOH-BOHVBHFʣͰ͢z ൈਮ ͪΐ͏ͥͭιϑτΣΞઃܭೖᴷᴷ
1)1Ͱཧղ͢ΔΦϒδΣΫτࢦͷ׆༻ 6.-
ͭ·Βͳ͍ޡղͳ͑͘Δᶃ ਖ਼͍͠จষͰ දݱ͢Δ ͭ·Βͳ͍ޡղͳ͑͘Δ 👍
ͭ·Βͳ͍ޡղͳ͑͘Δᶄ ਖ਼͍͠จষͱ ਖ਼͍͠6.-Ͱ දݱ͢Δ ਖ਼͍͠จষͰ දݱ͢Δ ͭ·Βͳ͍ޡղͳ͑͘Δ ˠ 👍 💯
UML *NBHFDSFBUFECZ4UBCMF%J ff VTJPO0OMJOFIUUQTTUBCMFEJ ff VTJPOXFCDPN
ͭ·Βͳ͍ޡղͳ͑͘Δᶅ ਖ਼͍͠จষͱ ਖ਼͍͠6.-Ͱ දݱ͢Δ ਖ਼͍͠จষͰ දݱ͢Δ ਖ਼͍͠จষͱ ਤͰ දݱ͢Δ ͭ·Βͳ͍ޡղͳ͑͘Δ
ˠ ˠ 👍 💯 🎉
·ͣਤͱͯ͠ඳ͘
6.-ͱͯ͠ͷਖ਼͠͞ ޙ͔Β͍ͯ͘Δ
͜Ε͕ʮ;ΜΘΓ͏ʯ
1MBOU6.-ͷجຊॻࣜ
ॻࣜͷجຊ @startuml ཁૉAͷఆٛ ཁૉBͷఆٛ ཁૉAͱཁૉBͷؔ࿈ @enduml
γʔέϯεਤ @startuml participant Alice participant Bob Alice -> Bob @enduml
Ϋϥεਤ @startuml class Alice class Bob Alice -> Bob @enduml
Ϣʔεέʔεਤ @startuml usecase Alice usecase Bob Alice -> Bob @enduml
Ϣʔεέʔεਤ @startuml (Alice) -> (Bob) @enduml ϢʔεέʔεؙׅހͰғΜͰ͍·͢ ؙׅހͷରପԁʹࣅ͍ͯΔ͔ΒͰ͢
IUUQTQMBOUVNMDPNKBVTFDBTFEJBHSBN
ཁૉҎ্ͷؔ࿈ͷॻ͖ํ @startuml usecase Alice usecase Bob usecase Carol Alice ->
Bob -> Carol @enduml ❌
ཁૉҎ্ͷؔ࿈Ͱཁૉͣͭॻ͘ @startuml usecase Alice usecase Bob usecase Carol Alice ->
Bob Bob -> Carol @enduml ⭕
͜ͷه๏Ҏ֎Ͱ ཁૉؒͷؔ࿈Λඳ͘ਤ͋Δ +40/ͱ͔:".-ͱ͔ ϚΠϯυϚοϓͱ͔
1MBOU6.-ͰਤΛඳը͢Δ
ίϚϯυϥΠϯͰϑΝΠϧΛม $ java -jar plantuml.jar file.puml -t png %PXOMPBEGSPNQMBOUVNMDPN PS
CSFXJOTUBMMQMBOUVNM
ެࣜαΠτͷ0OMJOF4FSWFSͰม 0OMJOF4FSWFSϝχϡʔ͔Β͏
%PDLFSDPOUBJOFSQMBOUVNMTFSWFS $ docker run -d -p 8080:8080 \ plantuml/plantuml-server http://localhost:8080/
ςΩετΤσΟλ*%&ͱͷ࿈ܞ ࿈ܞํ๏KBSϑΝΠϧͩͬͨΓ 0OMJOF4FSWFSʢ"1*4FSWFSʣͩ ͬͨΓ ΤσΟλ࿈ܞ https://plantuml.com/ja/running
8FCαʔϏεΛ͏ w 1MBOU6.-ରԠͷ8FCαʔϏεͷྫ w )BDL.% IUUQTIBDLNEJP w FTB IUUQTFTBJP
ʲҙʳ ଞਓ͕ཧ͍ͯ͠Δ0OMJOF4FSWFSʹ ൿີใΛهࡌ͠ͳ͍
QBUIΛσίʔυ͢Δͱɺ ݩͷίʔυʹͳΔ
ࠓ͜͜ͰαϯϓϧΛࢼ͚ͩ͢ͳΒ )BDL.%͕͓ख͔ܰ ηοτΞοϓෆཁ ϑϦʔϓϥϯ͋Γ
Θͨ͠ͷར༻๏
Θͨ͠ͷར༻๏ w ઃܭϑΣʔζͰͷ಄ͷཧ w ։ൃ࣌ͷιʔείʔυɾϦʔσΟϯά w ӡ༻υΩϡϝϯτͰͷิઆ໌
ઃܭϑΣʔζͰͷ͍ํ w ΞʔΩςΫνϟͷཧ w σʔλߏͷཧ w γʔέϯεਤ͔Βڞ௨ॲཧΛ୳Δ w ίʔυΛॻ͍͔ͯΒؾ͘ͱखΓ͕ൃੜ͢Δ߹͕͋Δ
ΞʔΩςΫνϟਤͷྫᶃ @startuml (User) -> (API) (API) -> (DB) ' Queue
(API) --> (Queue) (Queue) <-- (Subscriber) (Subscriber) -> (MTA) @enduml
ΞʔΩςΫνϟਤͷྫᶄ @startuml actor User queue Queue database DB (User) ->
(API): POST /register (API) -> (DB): Save ' Queue (API) --> (Queue): Publish Message (Queue) <-- (Subscriber): Subscribe Message (Subscriber) -> (MTA): Email @enduml
ΞʔΩςΫνϟਤͷྫᶅ @startuml !include <awslib/AWSCommon> !include <awslib/AWSSimplified> !include <awslib/General/Users> !include <awslib/Database/Aurora>
!include <awslib/ApplicationIntegration/SimpleQueueService> !include <awslib/BusinessApplications/SimpleEmailService> Users(User, "User", "tech") Aurora(DB, "DB", "tech") SimpleQueueService("Queue", "Queue", "tech") SimpleEmailService("MTA", "MTA", "tech") (User) -> (API): POST /register (API) -> (DB): Save ' Queue (API) --> (Queue): Publish Message (Queue) <-- (Subscriber): Subscribe Message (Subscriber) -> (MTA): Email @enduml
γʔέϯεਤͷྫᶃ @startuml User -> API: POST /save API -> API:
Create Message API -> Queue: Publish Message API <-- Queue: OK User <-- API: OK == Subscriber Process == Queue <- Subscriber: Fetch Message Queue --> Subscriber: Message Subscriber -> DB: Save Subscriber <-- DB: OK @enduml
;ΜΘΓ͏ͱ͖ͷϙΠϯτ w ਤͻͱͭ͡Όͳͯ͘ྑ͍ w ཻΛม͑ͨෳͷਤ w શମ֓ཁͱॲཧৄࡉ w ʮԿ͔ਖ਼֬ʹඳ͔ͳΕʂʯΈ͍ͨͳ໋ײΕΔ w
͍͕ͭΜΓͨ͘ͳΔ͕ɺ͕ΜΒͳ͍
ιʔείʔυɾϦʔσΟϯάͰͷར༻ w ʮѲ͖͠Ε͍ͯͳ͍ػೳͷमਖ਼ʯͳͲͷͱ͖ʹ͏ w ΤσΟλͷػೳͰॲཧͷࢀরݩΛ͍ͬͯ͘ w ϝιου୯ҐͳͲͰϓϩοτ͠ɺؔ࿈͚͍ͯ͘ w Ͳͷ෦ʹमਖ਼ΛՃ͑Δͷ͕Ұ൪εδ͕ྑͦ͞͏͔Λ୳Δ
ιʔείʔυɾϦʔσΟϯάͷྫ @startuml skinparam usecase<<DEPRECATED>> { backgroundColor #fcc } skinparam usecase<<RENEW>>
{ backgroundColor #cfc } ' command ܥ rectangle "terminate Command" as terminateCommand usecase "TerminationService::exec()" as terminateService ' admin ܥ rectangle "POST /admin/delete API" as adminDeleteApi usecase "Admin\DeleteService::delete()" as adminDeleteService ' আຊମ usecase "Deprecated\DeleteService::delete()" as deleteServiceDeprecated <<DEPRECATED>> usecase "DeleteService::delete()" as deleteService <<RENEW>> usecase "Ճใͷআॲཧ" as deleteInfo <<RENEW>> ' unregister ܥ rectangle "POST /unregister API" as unregisterApi usecase "UnregisterService::unregister()" as unregisterService ' command ܥ (terminateCommand) --> (terminateService) (terminateService) --> (deleteServiceDeprecated) ' admin ܥ (adminDeleteApi) --> (adminDeleteService) (adminDeleteService) --> (deleteServiceDeprecated) (deleteServiceDeprecated) --> (deleteService) ' unregister ܥ (unregisterApi) ---> (unregisterService) (unregisterService) --> (deleteService) ' RENEW (deleteService) --> (deleteInfo) @enduml
;ΜΘΓ͏ͱ͖ͷϙΠϯτ w શ෦Λඳ͜͏ͱ͕ΜΒͳ͍ w ඳ͘ͷ͕తͰͳ͘ɺඳ͍ͨ݁ՌͰॲཧΛѲ͢Δͷ͕త w ඞཁͳՕॴQSJWBUFϝιουͷॲཧͰϓϩοτ͢Δ w ࣗͰѲ͚͢͠Εɺଟগཻ͕ϒϨͯؾʹ͠ͳ͍
1MBOU6.-ͷֶͼํ
w ඳ͚Δਤͷ༰͕ཏ͞Ε͍ͯΔ w ߏཱ͕ମతͰͪΐͬͱ͍ʹ͍͘ w ʢࠂαΠζͪΐͬͱେ͖Ίʣ ඞཁͳใެࣜαΠτʹ͋Δ IUUQTQMBOUVNMDPN
ެࣜαΠτͷ͍ํ IUUQTQMBOUVNMDPN ਤ͝ͱͷϦϯΫ ʢ⾢ͰεΫϩʔϧʣ ֤ϖʔδ ڞ௨ϝχϡʔ ݴޠସ ϖʔδ֊ߏ
݄ݱࡏ
ϦϑΝϨϯεΨΠυʢ1%'ΨΠυʣ IUUQTQMBOUVNMDPNKBHVJEF
ϦϑΝϨϯεΨΠυͷΦεεϝϙΠϯτ IUUQTQMBOUVNMDPNKBHVJEF w ͦΕͧΕͷਤ͝ͱʹষཱͯ w ॻ͖͍ͨਤͷใΛ͍͍͢ w ʢࠂ͕ͳ͍ʣ
w (JU)VC4QPOTPST w 1BUSFPO w -JCFSBQBZ w 1BZ1BM 1MBOU6.-͕༗༻ͩͱࢥͬͨΒεϙϯαʔʹ IUUQTQMBOUVNMDPNKB
εϙϯαʔಛయͱͯ͠BEGSFF൛ͷ XFCTJUFΛ͑Δ εϙϯαʔಛయ IUUQTQMBOUVNMDPNQBUSFPOKB
·ͱΊ
ਤΛ;Θͬͱඳ͜͏
;Θͬͱ͍ͯͯ͠ ޡղͳ͘ΘΔ্͕֬Δ
ਖ਼֬͞ޙ͔Β͍ͯ͘Δ
"QQFOEJY
ཁૉͷϨΠΞτௐ w ϨΠΞτ1MBOU6.-ʹͤΔͷ͕جຊ w ϨΠΞτΛᘳʹ͍͑ͨͳΒผͷπʔϧΛͬͨ΄͏͕͍͍ w ͋Δఔͷௐޮ͘ w ϥΠϯͷ͞ w
ҹͷํΛௐ w άϧʔϐϯά w ఆٛॱ
ϥΠϯͷ͞ @startuml (A) - (B) (A) -- (C) (A) ---
(D) (A) ---- (E) @enduml
ҹͷํΛௐ @startuml (A) -r-> (B) (A) -d-> (C) (A) -l->
(D) (A) -u-> (E) @enduml SJHIUMFGU EPXOVQ
άϧʔϐϯά @startuml rectangle Group { (B) (C) } (A) ->
(B) (A) -> (C) @enduml
άϧʔϐϯάͱIJEEFOϥΠϯ @startuml rectangle Group { (B) (C) (B) -d[hidden]- (C)
} (A) -> (B) (A) -> (C) @enduml EEPXOͷ͜ͱ ଞͷํࢦఆͰ͖Δ
ཁૉͷఆٛॱ @startuml (A) -> (B) @enduml @startuml (B) <- (A)
@enduml
ݟͨͷมߋ w ςʔϚʢUIFNFʣΛ͏ w ϥΠϒϥϦΛ͏ w TLJOQBSBNΛ͏
ςʔϚʢTQBDFMBCʣ @startuml !theme spacelab (A) -- (B) (A) -- (C)
@enduml ΈࠐΈͷςʔϚͷҰཡ IUUQTQMBOUVNMDPNKBUIFNF
ϥΠϒϥϦΛ͏ @startuml !include <awslib/AWSCommon> !include <awslib/AWSSimplified> !include <awslib/General/Users> !include <awslib/Database/Aurora>
!include <awslib/Database/DynamoDB> Users(A, "A", "tech") DynamoDB(B, "B", "tech") Aurora(C, "C", "tech") (A) -- (B) (A) -- (C) @enduml ΈࠐΈͷϥΠϒϥϦͷҰཡ IUUQTQMBOUVNMDPNKBTUEMJC
৭Λม͑ͯݟ͘͢͢Δ @startuml skinparam usecase { backgroundColor #fcc } (A) --
(B) (A) -- (C) @enduml શͯͷVTFDBTF͕ର
৭Λม͑ͯݟ͘͢͢ΔʢಛఆͷཁૉͷΈʣ @startuml skinparam usecase<<SPECIAL>> { backgroundColor #fcc } usecase A
<<SPECIAL>> (A) -- (B) (A) -- (C) @enduml 41&$*"-ͷϥϕϧ͕͍ͨ VTFDBTFͷΈ͕ର
TLJOQBSBNͷݕࡧ IUUQTQMBOUVNMEPDVNFOUBUJPOSFBEUIFEPDTJPFOMBUFTUGPSNBUUJOHBMMTLJOQBSBNTIUNM "TIMFZT1MBOU6.-%PD ࢦఆՄೳͳTLJOQBSBNΛݕࡧ
3FGFSFODFT
3FGFSFODFT w 1MBOU6.- w IUUQTQMBOUVNMDPN w "TIMFZT1MBOU6.-%PD w IUUQTQMBOUVNMEPDVNFOUBUJPOSFBEUIFEPDTJPFOMBUFTU GPSNBUUJOHBMMTLJOQBSBNTIUNM
w ͪΐ͏ͥͭιϑτΣΞઃܭೖ w IUUQTHJIZPKQCPPL
3FGFSFODFT w 4UBCMF%J ff VTJPO0OMJOF w IUUQTTUBCMFEJ ff VTJPOXFCDPN w
"NBOJTMPPLJOHVQBUBIJHIXBMM5IFXBMMJTNBEFPGCSJDLT5IF XBMMJTNFUFSTIJHI