Re: using Component for replacing dependencies in tests

2014-09-16 Thread Anvar Karimson
Ok, excellent! So then, when constructing the system-map for prod it would look something like this: (defn new-system [config-options] (let [{:keys [store-create-fn]} config-options] (component/system-map :store (new-store store-create-fn) ... ))) (new-system {:stor

Re: using Component for replacing dependencies in tests

2014-09-16 Thread Michael Klishin
On 16 September 2014 at 12:13:13, Anvar Karimson (an...@karimson.com) wrote: > Option 1, separate lifecycle from the actual store: I've seen this approach in use, it works well.  -- @michaelklishin, github.com/michaelklishin -- You received this message because you are subscribed to the Google

using Component for replacing dependencies in tests

2014-09-16 Thread Anvar Karimson
Hi, I am trying to wrap my head around how to best use the Component library for structuring my app. Let's say I have a simple Store protocol: (defprotocol Store (get [store k]) (put [store k v])) The production Store protocol implementation would, as an example, be backed by Riak but in