wolf4earth
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.
Most Liked
0x6a68
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: https://gist.github.com/jhattwich/6f7acbaaa3cd2f9cdbf2afe8c13328f0
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









