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
Haze - Real time background blurring
chrisbanes
1
510
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
testcontainers のススメ
sgash708
1
120
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
2
260
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
42 best practices for Symfony, a decade later
tucksaun
1
180
Featured
See All Featured
Side Projects
sachag
452
42k
Faster Mobile Websites
deanohume
305
30k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Agile that works and the tools we love
rasmusluckow
328
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
The Art of Programming - Codeland 2020
erikaheidi
53
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Facilitating Awesome Meetings
lara
50
6.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
What's in a price? How to price your products and services
michaelherold
243
12k
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