At a first casual glance, “Organizing Clojure code” might sound like a trivial problem to some. It’s easy to get it wrong because it’s subtle. The real question is not just about how to organize code, which is a static artifact, but rather how to organize the runtime manifestation of that code in production, tests, development, and REPL, etc. This blog post is inspired by the discussion at https://clojureverse.org/t/organizing-clojure-code-a-real-problem/7567 and here we try to explore the various aspects of organizing Clojure code. You only need elementary knowledge of Functional Programming and Clojure application development at the minimum to follow along.
Do we need Dependency Injection with Clojure? That’s a slightly misplaced question — it does not even begin with the problem definition. Clojure is a functional programming language. In this post we would explore the “dependency problem” with Clojure programming and what dependency injection can bring to the table. Later, we discuss DIME, a Push-model based dependency injection library.
Consider the following function:
(fn save-order [db-connection order-details]) ; caller passes two args
This function requires the caller to pass two arguments, which forms its API contract. It all sounds well until the caller is in conflict with this contract. What…
Update (2019, Feb 11): Code snippet updated to configure client mode.
More and more websites and web services are adopting HTTPS today, which makes SSL termination on dedicated IP addresses increasingly challenging. Server Name Indication is a common way to multiplex multiple SSL termination on a single IP address. SNI is implemented as a Transport Layer Security (TLS) extension, hence connecting with an SNI-enabled HTTPS endpoint requires an SNI-aware client.