Slides can be found here: stuartsierra.com/download/2014-06-27-components-euroclojure.pdf
Functional programming with immutable values is wonderful, but sooner or later every program has to deal with stateful, imperative tasks. A large program may need to manage dozens of stateful services: database connections, thread pools, network services, scheduled tasks, and caches. How do we do this in a functional programming model? All too often we fall back, almost by accident, into global mutable state, promiscuous sharing, and imperative spaghetti code.
To escape this quagmire, we need to recall some basic principles of both functional and object-oriented programming: referential transparency, immutable values, message-passing, encapsulation, and interface contracts. The Component pattern and its library implementation offer a minimal way to structure the stateful dependencies of a functional program.
This talk will cover the motivation for the Component pattern, its benefits and downsides, comparisons with other approaches, and how to use it in Clojure programs.