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モジュール入門
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kent OHASHI
November 28, 2019
Programming
0
99
Ductモジュール入門
Clojureフレームワーク"Duct"の拡張方法を理解しよう!
Kent OHASHI
November 28, 2019
Tweet
Share
More Decks by Kent OHASHI
See All by Kent OHASHI
Property-Based Testing with test.check and clojure.spec
lagenorhynque
0
20
🐬の推し本紹介2025: 『コーディングを支える技術 ――成り立ちから学ぶプログラミング作法』
lagenorhynque
0
74
KotlinでミニマルなResult実装による関数型エラーハンドリング
lagenorhynque
0
30
Functional Calisthenics in Kotlin: Kotlinで「関数型エクササイズ」を実践しよう
lagenorhynque
1
260
関数型言語テイスティング: Haskell, Scala, Clojure, Elixirを比べて味わう関数型プログラミングの旨さ
lagenorhynque
1
150
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
190
From Scala/Clojure to Kotlin
lagenorhynque
0
84
TDD with RDD: Clojure/LispのREPLで変わる開発体験
lagenorhynque
0
110
🐬の推し本紹介2024: 『脱・日本語なまり 英語(+α)実践音声学』
lagenorhynque
1
150
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
540
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
CSC307 Lecture 07
javiergs
PRO
0
550
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
270
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
600
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Oxlint JS plugins
kazupon
1
870
CSC307 Lecture 08
javiergs
PRO
0
670
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
CSC307 Lecture 03
javiergs
PRO
1
490
Featured
See All Featured
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
For a Future-Friendly Web
brad_frost
182
10k
Designing for humans not robots
tammielis
254
26k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
Paper Plane (Part 1)
katiecoart
PRO
0
4.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
75
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
73
30 Presentation Tips
portentint
PRO
1
210
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
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 開発してみた