Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
goplantumlの紹介
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
noru
April 28, 2024
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
goplantumlの紹介
Kyoto.go #50 オフラインLT会
noru
April 28, 2024
More Decks by noru
See All by noru
歴史から学ぶCQRS/ES
genkihirano
0
590
connect-goで実現するカスタムエラー
genkihirano
1
290
Featured
See All Featured
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Marketing to machines
jonoalderson
1
5.9k
Writing Fast Ruby
sferik
630
63k
Documentation Writing (for coders)
carmenintech
77
5.6k
The Invisible Side of Design
smashingmag
301
52k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
How STYLIGHT went responsive
nonsquared
100
6.3k
Speed Design
sergeychernyshev
33
2.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Transcript
goplantumlの紹介 Kyoto.go #50 noru
自己紹介 noru ・Go言語を書くことが多いです ・設計も好きです ・京都とは関係ないけど、東京から飛んできました笑 ・将来ノルウェージャン・フォレスト・キャットと暮らしたい ・Xアカウント:@gopher86kawaii
会社紹介 株式会社ブルーイッシュ ・Go, Rust, 生成AIエンジニア等を募集中 ・興味があれば覗いていただけると嬉しいです!
目次 1. goplantumlとの出会い 2. プロジェクトの課題 3. goplantumlの紹介 4. goplantumlを使ってみる 5.
goplantumlを導入したメリット 6. まとめ
1. goplantumlとの出会い ・「設計で使える良いツールないかなぁ...」とGoogleとXで探してたところ、良さげ なツールを見つけた! ・しかもGoで使える! ・プロジェクトの課題を解決できるかも。試してみるしかない💪
2. プロジェクトの課題 ・ドキュメントとコードの乖離 ・ドメインモデル図 (他の設計書も含む) とコード間の乖離が徐々に発生 ・ドキュメントの更新が追いついてない ・コードのキャッチアップ (特にドメイン) に時間がかかる
・新規メンバーがプロジェクトに参画する時 ・カオスなコードをリファクタリングする時
3. goplantumlの紹介 GoのソースコードからUMLクラス図 を自動生成するツール ・似た様なライブラリで bykof/go-plantumlが存在するが、 Star数はgoplantumlの方が多い
3. goplantumlの紹介 Dumels(https://www.dumels.com/) でも使用されている ・GoのGitHub Repository URLを検 索するとUML図を生成してくれる Webサービス
3. goplantumlの紹介 使用方法 ・goplantuml [-recursive] path > output.puml でpumlファイルを自動生成 ・go
install github.com/jfeliu007/goplantuml@latest ・https://github.com/jfeliu007/goplantuml
3. goplantumlの紹介 オプションを一部紹介 ・-recursive: path内の全ディレクトリを再帰的に探索 ・-hide-fields: フィールドを非表示で出力 ・-hide-methods: メソッドを非表示で出力 ・-hide-connections:
依存関係を非表示で出力
4. goplantumlを使ってみる 生成対象のGoコード ・model ・User, Name, Addressの構造体 ・Name構造体はFullNameメソッドを 持っている
4. goplantumlを使ってみる pumlファイル自動生成 ・goplantuml -recursive ./model > goplantuml.puml実行
4. goplantumlを使ってみる UML図で表示 ・VSCode拡張機能「PlantUML」で pumlファイル→UML図を表示 ・構造体とメソッドがUML図で可視化 された
5. goplantumlを導入したメリット ドメインモデル図との乖離の発見速度の向上 ・ドメインモデル図に限らず、ドキュメントの更新は忘れがち ・ドキュメントと実装がズレていると、新規参画メンバーや保守フェーズでどちら が正しいのか調査する時間が必要になる ・UML図で現状の構造を可視化することで、ドメインモデル図と乖離している箇 所を早期発見し、修正することができる
5. goplantumlを導入したメリット 新規参画メンバーのキャッチアップ (コードリーディング) 速度の向上 ・UML図を見ることで、コードを素早く把握 ・コード全体・各構造体やメソッドの設計 ・詳細が見えないので、キャッチアップ速度が向上する ・ドメインモデル図と見比べて、どのドメインが未実装か素早く把握できる
5. goplantumlを導入したメリット リファクタリングと品質保証の支援 ・肥大化したモデルに気付きやすくなる ・おかしなビジネスロジックの持たせ方に気付きやすくなる
5. goplantumlを導入したメリット PMやドメインエキスパートも現状のプロジェクトの構造を容易に理解 ・コードを書かないPMやドメインエキスパートも、UML図でプロジェクトの現状 の構造を簡単に把握できる ・コードを読むよりもとっつきやすい
6. まとめ ・Goのコードを可視化することで、様々なメリットが得られました ・簡単に導入できるので、良ければ試してみてください! ・ご清聴ありがとうございました