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
51
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
84
My Favourite Book in 2024: Get Rid of Your Japanese Accent
lagenorhynque
1
120
do Notation Equivalents in JVM languages: Scala, Kotlin, Clojure
lagenorhynque
0
84
map関数の内部実装から探るJVM言語のコレクション: Scala, Kotlin, Clojureコレクションの基本的な設計を理解しよう
lagenorhynque
0
78
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
72
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
100
Other Decks in Programming
See All in Programming
AI Agent 時代的開發者生存指南
eddie
3
1.8k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
33k
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
120
Introduce Hono CLI
yusukebe
6
2.6k
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
520
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
1k
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
250
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
260
Devvox Belgium - Agentic AI Patterns
kdubois
1
120
Go言語はstack overflowの夢を見るか?
logica0419
0
370
Catch Up: Go Style Guide Update
andpad
0
230
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
353
21k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The World Runs on Bad Software
bkeepers
PRO
72
11k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
KATA
mclloyd
32
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Music & Morning Musume
bryan
46
6.8k
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 開発してみた