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
Kent OHASHI
November 28, 2019
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ductモジュール入門
Clojureフレームワーク"Duct"の拡張方法を理解しよう!
Kent OHASHI
November 28, 2019
More Decks by Kent OHASHI
See All by Kent OHASHI
"Simple Made Easy" Made Easier: Clojureに学ぶsimplicity
lagenorhynque
0
13
Property-Based Testing with test.check and clojure.spec
lagenorhynque
0
49
🐬の推し本紹介2025: 『コーディングを支える技術 ――成り立ちから学ぶプログラミング作法』
lagenorhynque
0
110
KotlinでミニマルなResult実装による関数型エラーハンドリング
lagenorhynque
0
63
Functional Calisthenics in Kotlin: Kotlinで「関数型エクササイズ」を実践しよう
lagenorhynque
1
410
関数型言語テイスティング: Haskell, Scala, Clojure, Elixirを比べて味わう関数型プログラミングの旨さ
lagenorhynque
1
240
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
270
From Scala/Clojure to Kotlin
lagenorhynque
0
110
TDD with RDD: Clojure/LispのREPLで変わる開発体験
lagenorhynque
0
130
Other Decks in Programming
See All in Programming
RTSPクライアントを自作してみた話
simotin13
0
520
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
180
Inside Stream API
skrb
1
670
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
240
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
270
3Dシーンの圧縮
fadis
1
680
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
200
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
740
CSC307 Lecture 17
javiergs
PRO
0
320
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
480
Claspは野良GASの夢をみるか
takter00
0
180
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
640
Featured
See All Featured
Navigating Team Friction
lara
192
16k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
WENDY [Excerpt]
tessaabrams
11
38k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
240
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
570
Technical Leadership for Architectural Decision Making
baasie
3
400
Code Reviewing Like a Champion
maltzj
528
40k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
The Spectacular Lies of Maps
axbom
PRO
1
790
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 開発してみた