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
TypeScriptでDDD〜RepositoryとEntity編〜
Search
Shinse Tanaka
April 30, 2017
Programming
3.8k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScriptでDDD〜RepositoryとEntity編〜
We Are JavaScripters! @6th
https://wajs.connpass.com/event/54667/
Shinse Tanaka
April 30, 2017
More Decks by Shinse Tanaka
See All by Shinse Tanaka
PrimeNGという選択肢について
mrdshinse
0
850
Other Decks in Programming
See All in Programming
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
250
GraphQL の onError と Nullability のこれから
quramy
0
210
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
160
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
620
Spec-driven Development with AI
simas
PRO
0
2.3k
AmebaブログはKMPから卒業します
kmars0605
0
330
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
230
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
200
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
360
AI Augmentation Techniques with Liberty
ivargrimstad
1
390
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
300
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
730
Featured
See All Featured
Leo the Paperboy
mayatellez
10
2.4k
Code Review Best Practice
trishagee
74
20k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Mind Mapping
helmedeiros
1
430
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.6k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
600
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
560
How to make the Groovebox
asonas
2
2.5k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
570
Transcript
TypeScriptでDDD RepositoryとEntity編
自己紹介 ・不動産Techで働いてます。 ・Java/Scala/Ruby + ちょっとjs ・Web↔SI双方の技術を高めたい ・Node.js / TypeScriptでDDDしてみたい モチベーション
@mrdShinse @Shinse Tanaka
None
話すこと
https://github.com/mrdShinse/eve-linebot
ディレクトリ構成 ./app/application →アプリ起動時の設定やドメイン処理に 必要な前処理などを書く。 今回だとExpress.jsの起動。 ./domain →アプリケーションが解決したい問題や 業務の処理を書く。 ./infra →各レイヤーを実装するために必要な
具体的処理が書かれる。 今回だとMongo関係の処理。
ドメインとライブラリ依存を切り離したい
domainパッケージ
エンティティの定義 User →Entityとして定義。 nameはValueObject として定義する。
リポジトリ用読み書きインターフェース
ユーザーリポジトリの定義
domainパッケージにはmongoの処理を入れない! 続いてinfraパッケージ
Mongoリポジトリ共通親クラス
ユーザーリポジトリ
いい感じに
所感 ・TypeScriptのGenericsはいい ・TypeScriptでちゃんと設計してあげる事で・・・ (jsでそれ必要?という議論はあるがw) ・エンジニアの技術力の差を吸収することができる。 ・仕様の変更や依存ライブラリの変更に強くなる ・結果として、Node.jsで業務寄りなプログラムを書きやすくなる。 ・mongooseだとdomainとinfraの切り分けはできない・・・?``` ・DDDで書きやすいライブラリは未整備な状態。