Skip to content
0:00 / 0:00

#clojure#integrant#component

Introducing structure in Clojure - Jan Stepien - Codemotion Milan 2017

Codemotion

11K subscribers • 1 video on Hallway

YouTube
  • Recommended by 3 people: 3 in engineering communities.
  • A classic. People kept recommending it from 2018 to 2021.
  • Presented by Jan Stępień, software engineer
  • May be out of date. Uploaded 8 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

2.4K views8 years ago3 recommendations

Software designWeb developmentLisp and ClojureSoftware architectureDesign patterns

Jan Stępień explains how to structure a Clojure application, manage stateful components, and handle database connections using best practices.

Once you've got a couple of Clojure katas under your belt you start to wonder how to structure an entire application. Where does the logic go? Where do you respond to HTTP requests? Where to connect to the database and how to pass the connection to code which needs it? Let's see what the best practices are and which Clojure libraries can help us.

Why it's here

3 people recommend this

What people say. Recommended as an excellent guide on how to structure Clojure projects and manage stateful components.

Moments people linked to

u/jstepienin r/Clojure • Recommends

Introducing Structure in Clojure — Codemotion Milan 2017
23View on Reddit

u/eval2020in r/Clojure • Recommends

On “To mock or not to mock when testing?”

Jan Stępień did a great presentation about this way of structuring a Clojure project.
7View on Reddit

u/lambdacurryin r/Clojure • Recommends

On “New Clojurians: Ask Anything”

What is the best way of structuring a web API with stateful 'components'. I have seen tools like Integrant, Component and watched talks like this Introducing structure in Clojure but not seen many real implementations, most 'Clojure web' tutorials don't handle stateful components and the ones that do don't really cover how you could test the system. Is the general idea just pass your stateful component (map) down the entire system until you need it then pull out the stuff you need. `-> (start system) server api handler` ``` (integrant/ref or component/using method) {:db - :sms - :missiles - :server {:db :sms :missiles}} ``` ``` (defn handler {:keys [db} (fn request (get-use…