Thanks both. James, that is what I was hoping.

I guess I got a bit misled with the combination of his "Customers"
example in the video, the "all or nothing" warnings and "I do not
intend that application functions should receive the top-level system
as an argument. Rather, functions are defined in terms of components.
" (from the front page on github).

I guess we can just (:interesting-component system) once the system has started?

(Without writing a single line of code though, I can see the
temptation to make stateless consumers Components just for the ease of
use :)).

On 28 November 2014 at 15:00, James Reeves <ja...@booleanknot.com> wrote:
> On 28 November 2014 at 10:28, Colin Yates <colin.ya...@gmail.com> wrote:
>>
>> 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?
>
>
> Nope.
>
>>
>> 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?
>
>
> You only need to make something a component if it has a lifecycle. If you
> just want to use a database connection, pass the component as an argument to
> a function.
>
> Look at it another way: do you need to keep blob-query around? Does it have
> state? If not, then it doesn't need to be a component.
>
> - James
>
> --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/WC983q33Nes/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

Reply via email to