Knigge - An opinionated approach to behaviours

Knigge was born out of a desire to standardize dealing with behaviours and their implementations.

As great fans of mox we longed for an easy way to swap out implementations from the configuration which lead us to introduce a facade pattern, where a module’s sole responsibility was loading the correct implementation and delegating calls.

This pattern turned out to be very flexible and useful but required a fair bit of boilerplate code. Knigge was born out of an attempt to reduce this boilerplate to the absolute minimum.

You can read about our motivation in depth in our devblog.


Thanks for sharing and I already considered using Knigge, before I found a simple solution to avoid the boilerplate of behaviors and implementation details. Currently I leverage on Module.spec_to_callback/2, which is in my use-case good enough.

Along the lines I implemented it like this:


@0x6a68 Looks like the gist link no longer exists. I’d be much interested if you could publish it again!

1 Like



v1.4.0 - 2020-03-26


  • #18: Add default option to use Knigge
  • #22: Ease contributing by adding a CONTRIBUTING guide and a PULL_REQUEST_TEMPLATE


  • #19: Fix handling of callbacks without brackets
1 Like