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
1k
ふんわり使う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.3k
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
660
Automatically run the JavaScript test in multiple browsers
suzuki
5
6.1k
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.5k
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
320
受け取る人から提供する人になるということ
little_rubyist
0
230
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
CSC509 Lecture 11
javiergs
PRO
0
180
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
50
7.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Site-Speed That Sticks
csswizardry
0
23
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Pragmatic Product Professional
lauravandoore
31
6.3k
A Tale of Four Properties
chriscoyier
156
23k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
YesSQL, Process and Tooling at Scale
rocio
169
14k
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