integrant

2020-10-20T01:05:28.022500Z

Do you use Integrant in an all-encompassing fashion (all code is are weaved together using Integrant, the system map describes everything) or in a minimal fashion (only things that need to be initialized are represented in the system map, steady-state wiring between namespaces is just plain old function calls) ? I recently realized I was on the minimal side (use Integrant as little as required) - that's a tradeoff I made out of taste, not out of careful consideration. The search "Designing Clojure programs with Integrant" didn't yield a very bountiful harvest (wink wink blogger friends). https://lambdaisland.com/blog/2019-12-11-advent-of-parens-11-integrant-in-practice showcases what I deem minimal, while https://flexiana.com/2020/07/building-web-services-with-duct-1-part showcases the all-encompassing style (courtesy of Duct). I would be grateful if anyo of you had further reading on the topic. Opinions and guidance welcome, too.

1
➕ 1
2020-10-30T12:59:13.047500Z

I probably fall more towards what you’d call the all encompassing camp. Essentially something should be a component if it holds state of its own or needs to cause some kind of effect at init; is configured differently in different contexts, or depends on another component. I’d say the choice is between lots of minimal components, or fewer complected ones. simple vs easy. If you don’t end up creating multiple components, you end up creating monolithic ones, that need to mix concerns etc. Obviously you don’t want to reduce everything to the smallest possible thing for the sake of it though.

👍 1