Building Hermetic Systems
Who am I?
I’m the Lead Software Architect at
MojoTech in Providence, RI, that’s who.
We’re a software consultancy, and we’ve
built many web and mobile apps.
What can you expect to learn?
• How hermeticity is an example of functional design thinking
• How to identify “leaks” in not-so-hermetic systems
• How to leverage Clojure to build and manage hermetic systems
What are components?
(defrecord ExampleComponent [options cache database scheduler]
(println ";; Starting ExampleComponent")
;; In the 'start' method, a component may assume that its
;; dependencies are available and have already been started.
(assoc this :admin (get-user database "admin")))
(println ";; Stopping ExampleComponent")
;; Likewise, in the 'stop' method, a component may assume that its
;; dependencies will not be stopped until AFTER it is stopped.
How can we model time?
(defn application [from-tick to-tick]
“Run our important application.”
(let [clock (new-clock from-tick to-tick)]
;; Run from tick 0 to 100
(application 0 100)
;; Run from tick 0 to 200
(application 0 200)
;; Run from tick 200 to 300
(application 200 300)