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
Duct Module Getting Started
Search
Kent OHASHI
November 28, 2019
Programming
0
92
Duct Module Getting Started
Ductモジュール入門
Clojureフレームワーク"Duct"の拡張方法を理解しよう!
Kent OHASHI
November 28, 2019
Tweet
Share
More Decks by Kent OHASHI
See All by Kent OHASHI
関数型言語テイスティング: Haskell, Scala, Clojure, Elixirを比べて味わう関数型プログラミングの旨さ
lagenorhynque
1
76
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
66
From Scala/Clojure to Kotlin
lagenorhynque
0
29
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
55
My Favourite Book in 2024: Get Rid of Your Japanese Accent
lagenorhynque
1
88
do Notation Equivalents in JVM languages: Scala, Kotlin, Clojure
lagenorhynque
0
63
map関数の内部実装から探るJVM言語のコレクション: Scala, Kotlin, Clojureコレクションの基本的な設計を理解しよう
lagenorhynque
0
58
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
55
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
85
Other Decks in Programming
See All in Programming
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
330
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
450
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
840
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
550
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
11
2k
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
0
120
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
F#で自在につくる静的ブログサイト - 関数型まつり2025
pizzacat83
0
310
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
11
2.8k
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
120
Perplexity Slack Botを作ってAI活用を進めた話 / AI Engineering Summit プレイベント
n3xem
0
670
Featured
See All Featured
Done Done
chrislema
184
16k
Practical Orchestrator
shlominoach
188
11k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Code Review Best Practice
trishagee
68
18k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
20k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Faster Mobile Websites
deanohume
307
31k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Transcript
Duct モジュール⼊⾨ Duct モジュール⼊⾨ Clojure フレームワーク "Duct" の拡張⽅法を理解しよう Clojure フレームワーク
"Duct" の拡張⽅法を理解しよう
lagénorhynque lagénorhynque (defprofile lagénorhynque :id @lagenorhynque :reading "/laʒenɔʁɛ̃ k/" :aliases
[" カマイルカ "] :languages [Clojure Haskell English français] :interests [programming language-learning law mathematics] :commits ["github.com/lagenorhynque/duct.module.pedestal" "github.com/lagenorhynque/duct.module.cambium"] :contributes ["github.com/japan-clojurians/clojure-site-ja"])
1. Integrant の基本 2. Duct の基本 3. Duct モジュールの作り⽅
Integrant の基本 Integrant の基本
とは とは 依存関係に従ってライフサイクル管理を⾏う仕組み cf. , , Integrant Integrant Component mount
Clip
ライフサイクルフックとしてのマルチメソッド ライフサイクルフックとしてのマルチメソッド デフォルト: 何もしない デフォルト: 何もしない デフォルト: init-key と同じ デフォルト:
halt-key! と同じ integrant.core/prep-key integrant.core/init-key integrant.core/halt-key! integrant.core/resume-key integrant.core/supend-key!
Duct の基本 Duct の基本
とは とは Integrant に対する便利な拡張 Duct Duct
Leiningen テンプレート Leiningen テンプレート duct duct # API 関連、ルーティングライブラリ Ataraxy
、サンプルコード付き $ lein new duct <project name> +api +ataraxy +example
コア機能 コア機能 duct/core duct/core duct.core/load-hierarchy duct.core/read-config duct.core/prep-config
標準モジュール 標準モジュール duct/module.web duct/module.ataraxy duct/module.sql duct/module.cljs duct/module.logging
Duct モジュールの作り⽅ Duct モジュールの作り⽅
実装⽅法 実装⽅法 Clojure サーバサイドフレームワークDuct ガイド > Duct の「モジュール」とは
実例 1: 実例 1: API/ サービス開発ライブラリ を組み込む モジュール 標準モジュール の代替
duct.module.pedestal duct.module.pedestal Pedestal duct/module.web
実例 2: 実例 2: JSON 形式でのログ出⼒を可能にするライブラリ を組み込むモジュール 標準モジュール の代替 duct.module.cambium
duct.module.cambium Cambium duct/module.logging
Further Reading Further Reading 第3 章: Clojure によるデータ指向DSL を駆使 したREST
API 開発 Clojure/ClojureScript 関連リンク集 > Web サーバ サイド (Clojure) Clojure サーバサイドフレームワークDuct ガイド 『3 つのLisp 3 つの世界』 Clojure のDuct でWeb API 開発してみた