Re: [ANN] Component: dependency injection and state management

2014-01-05 Thread Korny Sietsma
Hi - I've been playing with this and I'm a little confused. I can understand how you use the library to pass around stateful components, and to start/stop them and wire them up etc. But I'm not sure I see how it should be used for more general dependency injection. I'll pick a concrete example

Re: [ANN] Component: dependency injection and state management

2014-01-05 Thread Stuart Sierra
Hi Korny, Components implementing protocols can provide different implementations. In the Database example, both the real component and the stub component would have to implement some common protocol that defines the primitive capabilities needed by the application. Traditional update-in-place

Re: [ANN] Component: dependency injection and state management

2014-01-05 Thread Korny Sietsma
Thanks - I'd kind-of worked that out after posting (with the aid of a walk outside, and a beer!) but it's nice to know I'm on the right track. On 5 Jan 2014 19:05, Stuart Sierra m...@stuartsierra.com wrote: Hi Korny, Components implementing protocols can provide different implementations. In

Re: [ANN] Component: dependency injection and state management

2013-11-21 Thread Jan Herich
This is simple brilliant... The approach proposed and the component framework implementing it finally solves the issue with the necessary evil (start/stop interactions with statefull components in any bigger Clojure app) by cleverly taking only the best ideas (like using inferred dependency

Re: [ANN] Component: dependency injection and state management

2013-11-21 Thread abp
Hi, great work indeed. One question though: Why do you prefer declaring dependencies between components of a system explicitly instead of using prismatics Graph? On Thursday, November 21, 2013 3:01:19 AM UTC+1, Stuart Sierra wrote: This is a small library/framework I've been working on for a

Re: [ANN] Component: dependency injection and state management

2013-11-21 Thread Ben Mabey
On Thu Nov 21 07:14:16 2013, Stuart Sierra wrote: On Thursday, November 21, 2013 7:22:10 AM UTC-5, abp wrote: Why do you prefer declaring dependencies between components of a system explicitly instead of using prismatics Graph? 'Graph' by itself does not preserve the dependency relationships

Re: [ANN] Component: dependency injection and state management

2013-11-21 Thread Stuart Sierra
On Thursday, November 21, 2013 7:22:10 AM UTC-5, abp wrote: Why do you prefer declaring dependencies between components of a system explicitly instead of using prismatics Graph? 'Graph' by itself does not preserve the dependency relationships after constructing the map. But the two approaches

[ANN] Component: dependency injection and state management

2013-11-20 Thread Stuart Sierra
This is a small library/framework I've been working on for a few months. https://github.com/stuartsierra/component I use this to manage runtime state in combination with my reloaded workflow using tools.namespace.[1] I've started using this on some personal and professional projects and it