Skip to content

kumarshantanu/dime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dime

Build Status cljdoc badge

Dependency Injection Made Easy for Clojure. This blog post explains the premise.

Rationale

Initializing and wiring up components in a non-trivial application could be a complex and brittle affair. It could be stateful, repetitive, messy or all of those. Dime aims to make that process less error-prone, repeatable and easy to reason about by implementing mostly-automated dependency injection/inversion.

Goals

  • Easy, push-model dependency injection
  • Flexible and easy lifecycle management
  • Thorough testability, avoiding pitfalls
  • Avoid mutation (except in development)

Caveats (Trade off)

  • Opinionated in favor of decoupling
  • Cascading dependencies (minimize with Onion Architecture or Functional Core, Imperative Shell approach)
  • Overhead of tagging all dependencies
  • Cannot inject in multimethods out of the box

Other work

The following projects take different approaches to dependency management:

Usage

Clojars coordinates: [dime "0.5.2"]

See Documentation

Discuss

Slack channel: #dime (you need an invitation from http://clojurians.net/ to join the Clojurian Slack team)

Development

Running tests:

$ lein do clean, test       # run tests in lowest supported Clojure version

License

Copyright © 2016-2021 Shantanu Kumar

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Dependency Injection Made Easy for Clojure

Resources

License

Stars

Watchers

Forks

Packages

No packages published