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
1.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.4k
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.7k
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
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
270
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
Full stack testing :: basic to basic
up1
1
930
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
750
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Haze - Real time background blurring
chrisbanes
1
510
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
What's in a price? How to price your products and services
michaelherold
243
12k
Code Review Best Practice
trishagee
65
17k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Making Projects Easy
brettharned
116
5.9k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
96
Designing Experiences People Love
moore
138
23k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
A Modern Web Designer's Workflow
chriscoyier
693
190k
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