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
種族値合計600以上のポケモンを返すAPIをクリーンアーキテクチャで作成した
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
keigo
July 26, 2026
8
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
種族値合計600以上のポケモンを返すAPIをクリーンアーキテクチャで作成した
keigo
July 26, 2026
Transcript
7 slides
種族値合計600以上のポケモンを返すAPIを作成した
「クリーンアーキテクチャ」とは? 特徴 ・ソフトウェアの設計パターン ・依存の矢印が外側から内側へ (内側は外側を知らない) →ビジネスロジックが外部APIや DBに依存しない メリット ・テストが書きやすい ・保守性が高い
今回作ったもの 種族値の合計が 600以上の第一世代のポケモン を返すAPI ポケモンのデータ自体はPokeAPIから取得
今回作ったもの Entities ・ポケモンの型、ハイスタッツのルール Use Cases ・ポケモンを取得し、ハイスタッツに絞るという一連の処理 Gateways ・外部から取得したデータをユースケースが扱いやすい形 に変換 Drivers
・PokeAPIからポケモンを取得し、返すだけ
技術スタック ・Hono ・Vitest ・PokeAPI
学び・気づき レイヤーごとの役割が明確だから迷いがへる 実装時にどこに何を書こう、と悩む時間がなくなると思いました。 ビジネスルールを先に書くので、目的を見失いにくい 一番の目的を先に決めるので、実装途中で「あれ、なんか何がしたいのかわからなくなってきた」「目的とズレたことしてたか らやり直さなきゃ」みたいなのがなくなると思います。 とはいえ、この規模だとあまりメリットを感じない 上の二つのメリットを知ったものの、今回の規模だとクリーンアーキテクチャの良さを感じづらかったです。 PokeAPIのレスポ ンスが変わったり、別の
APIに変更したりすれば保守性の高さを実感できるはずです。
今後の展望 クリーンアーキテクチャでtodoアプリを作りたい。 ORMやDBの変更がどのくらい楽になるのか体感したい。
More Decks by keigo
See All by keigo
AIに任せる処理、 任せなくていい処理
keikeigo
0
4
ポケモン1000件取得が 5.29秒から0.64秒になった
keikeigo
0
13
APIとは?
keikeigo
0
14
WebアプリをDockerで動かしてみた
keikeigo
0
18
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
540
How to build a perfect <img>
jonoalderson
1
6.3k
Well, that’s weird…
csswizardry
1
210
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
A designer walks into a library…
pauljervisheath
211
25k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Mobile First: as difficult as doing things right
swwweet
225
10k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
Ruling the World: When Life Gets Gamed
codingconduct
0
450
Unsuck your backbone
ammeep
672
58k