This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-07
Channels
- # announcements (38)
- # asami (14)
- # beginners (35)
- # biff (3)
- # calva (29)
- # cider (20)
- # clj-kondo (7)
- # cljdoc (38)
- # clojure (64)
- # clojure-art (2)
- # clojure-australia (1)
- # clojure-dev (6)
- # clojure-europe (30)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (9)
- # clojured (3)
- # clojurescript (87)
- # cursive (17)
- # datahike (2)
- # datomic (10)
- # defnpodcast (2)
- # emacs (2)
- # events (1)
- # fulcro (25)
- # gratitude (1)
- # introduce-yourself (1)
- # jobs-discuss (21)
- # lsp (103)
- # malli (41)
- # meander (8)
- # minecraft (3)
- # missionary (3)
- # nextjournal (20)
- # off-topic (10)
- # pedestal (1)
- # polylith (15)
- # portal (6)
- # releases (2)
- # ring (1)
- # ring-swagger (2)
- # sci (4)
- # shadow-cljs (5)
- # spacemacs (3)
- # sql (11)
- # xtdb (3)
i think i've used :extend-via-metadata
only once, when i had an existing protocol-based codebase and needed to dynamically compose some components to satisfy a protocol... my recollection is that :extend-via-metadata
made life a lot easier, but i was never faced with the "or use a multimethod" choice because existing codebase
My interpretation is :extend-via-metadata
is useful for libraries (that look for that) and/or tooling.
The nice thing about :extend-via-metadata
is that you can provide implementations on an ad hoc basis, just by attaching metadata to a Clojure object. This is common with datafy
/`nav` for example, and we do it with Component at work quite a bit (attaching start
/`stop` implementations to hash maps or functions, instead of using defrecord
for some lifecycle).
So you don't need to define anything, no defrecord
, no defmethod
.