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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kent OHASHI
November 28, 2019
Programming
120
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
速習FP in Scala with Flix: Flix言語で親しむ純粋関数型のコード設計
lagenorhynque
0
26
"Simple Made Easy" Made Easier: Clojureに学ぶsimplicity
lagenorhynque
0
41
Property-Based Testing with test.check and clojure.spec
lagenorhynque
0
62
🐬の推し本紹介2025: 『コーディングを支える技術 ――成り立ちから学ぶプログラミング作法』
lagenorhynque
0
120
KotlinでミニマルなResult実装による関数型エラーハンドリング
lagenorhynque
0
78
Functional Calisthenics in Kotlin: Kotlinで「関数型エクササイズ」を実践しよう
lagenorhynque
1
460
関数型言語テイスティング: Haskell, Scala, Clojure, Elixirを比べて味わう関数型プログラミングの旨さ
lagenorhynque
1
280
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
300
From Scala/Clojure to Kotlin
lagenorhynque
0
120
Other Decks in Programming
See All in Programming
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
430
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
300
その節約、円になってますか?
isamumumu
1
710
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
450
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
370
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
150
5分で問診!Composer セキュリティ健康診断
codmoninc
0
910
Cloudflare is Agents
chimame
0
150
メールのエイリアス機能を履き違えない
isshinfunada
0
230
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
790
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How STYLIGHT went responsive
nonsquared
100
6.2k
Thoughts on Productivity
jonyablonski
76
5.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
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 開発してみた