Hi Colin, I'm by no means an expert on Component but I have used it for my last several projects. What I've discovered is where I have query functions such as yours I pass the db component through to their call sites from a component which contains the db as state. For example, I have a component which contains various HTTP routing logic. Some of my routes result in db queries. To facilitate this I pass the db all the way through. It's sometimes a little clunky and there may be better ways of doing this, e.g. maybe all the routes which depended on db state could be partitioned in their own component.
I hope that's helpful, Max > On Nov 28, 2014, at 03:28, Colin Yates <colin.ya...@gmail.com> wrote: > > Hi all, > > Am I right in thinking that in order to use > https://github.com/stuartsierra/component every consumer of a component must > also be a component? > > For example, if I have a component DB and I want to use that DB in (defn > blob-query [db criteria]...), do I pull the DB out of the system map and call > it or am I expected to make a BlobQuery component which offers a (blob-query > [criteria]) API? > > Initially I thought the "system" was just the stateful components, but after > watching https://www.youtube.com/watch?v=13cmHf_kt-Q and reading the doc, > particularly the "all or nothing" warnings I think I might have missed > something. > > Thanks! > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.