This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-27
Channels
- # announcements (2)
- # asami (5)
- # beginners (22)
- # biff (2)
- # cider (1)
- # clara (3)
- # clojure (17)
- # clojure-europe (7)
- # clojurescript (29)
- # core-async (2)
- # datahike (1)
- # fulcro (11)
- # gratitude (2)
- # integrant (2)
- # lsp (6)
- # music (2)
- # observability (1)
- # off-topic (36)
- # polylith (4)
- # quil (2)
- # reagent (15)
- # tools-deps (36)
- # xtdb (16)
Can components depend on other components and how?
Yes, I believe you can require a component just as with any other namespace. If I’m not mistaking, the components will know about each other because they are referenced in the project specific deps.edn (and the dev deps.edn). I found an example in the Polylith RealWorld repo: https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app/blob/master/components/article/src/clojure/realworld/article/core.clj#L5
Components only know about interfaces
which is something all components “implements” by exposing at least one namespace, e.g. com.mycompany.invoicer.interface
(`com.mycompany` is the top namespace in this example). Then other components can access invoicer
by require:ing that interface namespace. Each project then decides which concrete component to include (maybe a component with the name invoicer
or some other name, as long as it contains the namespace com.mycompany.invoicer.interface
).