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
96
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
100
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
110
From Scala/Clojure to Kotlin
lagenorhynque
0
49
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
80
My Favourite Book in 2024: Get Rid of Your Japanese Accent
lagenorhynque
1
110
do Notation Equivalents in JVM languages: Scala, Kotlin, Clojure
lagenorhynque
0
83
map関数の内部実装から探るJVM言語のコレクション: Scala, Kotlin, Clojureコレクションの基本的な設計を理解しよう
lagenorhynque
0
76
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
70
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
100
Other Decks in Programming
See All in Programming
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
2k
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
480
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
3
1.3k
GitHub Actions × AWS OIDC連携の仕組みと経緯を理解する
ota1022
0
250
ててべんす独演会〜Flowの全てを語ります〜
tbsten
1
220
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.4k
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
770
CSC509 Lecture 03
javiergs
PRO
0
330
iOS 17で追加されたSubscriptionStoreView を利用して5分でサブスク実装チャレンジ
natmark
0
650
What's new in Spring Modulith?
olivergierke
1
110
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
960
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
200
Featured
See All Featured
Balancing Empowerment & Direction
lara
4
680
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
890
Scaling GitHub
holman
463
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Side Projects
sachag
455
43k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
A better future with KSS
kneath
239
17k
Git: the NoSQL Database
bkeepers
PRO
431
66k
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 開発してみた