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
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
RubyLSPのマルチバイト文字対応
notfounds
0
120
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Jakarta EE meets AI
ivargrimstad
0
660
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Ethereum_.pdf
nekomatu
0
460
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
97
Faster Mobile Websites
deanohume
305
30k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
What's in a price? How to price your products and services
michaelherold
243
12k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
4 Signs Your Business is Dying
shpigford
180
21k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
How GitHub (no longer) Works
holman
310
140k
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