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
31
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
89
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
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
170
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
230
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
300
VS Code Update for GitHub Copilot
74th
1
310
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
210
すべてのコンテキストを、 ユーザー価値に変える
applism118
2
690
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
330
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
320
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
340
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
240
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
290
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
800
Featured
See All Featured
Practical Orchestrator
shlominoach
188
11k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
4 Signs Your Business is Dying
shpigford
184
22k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
What's in a price? How to price your products and services
michaelherold
246
12k
Side Projects
sachag
455
42k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
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 開発してみた