On Wednesday, March 11, 2015, Colin Yates wrote: > I can't merge the two systems because the reusable > component is chocka full of very fine grained command > handlers and both the internal and external systems will > have their own 'bus' for example. I could namespace the > keys but that again feels painful...
That's exactly how I would do it. Nested systems don't really work. But one system can contain implicit "groups" of components. Create each group as a map, then `merge` them into the system. Use namespaced keys to prevent clashes. The constructor functions for each component (or component group) can take an argument which tells them the names of their dependencies in the system. Pseudo example: (defn reusable-component [collaborator-key] (component/using (map->ReusableComponent {}) [:my/logger :my/bus collaborator-key])) (defn reusable-group [collaborator-key] {:my/logger ... :my/bus ... :my/reusable-component (reusable-component collaborator-key)}) (defn new-system [] (merge (system-map :main/logger ... :main/bus ... :main/collaborator ...) (reusable-group :main/collaborator))) -S -- 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.