Good foor for thought. Thanks both.
On 2 Mar 2015 23:43, "Jonah Benton" wrote:
> Hi Colin, for me this is usually an Invented Here/Not Invented Here
> question.
>
> When I'm inventing a thing with state and a lifecycle I'll define it as a
> Record and slap the Lifecycle protocol implementation o
Hi Colin, for me this is usually an Invented Here/Not Invented Here
question.
When I'm inventing a thing with state and a lifecycle I'll define it as a
Record and slap the Lifecycle protocol implementation onto it. I'd do that
with your Registry.
When I'm using a thing someone else made, usually
I would do the latter.
I like the extend types to component/Lifecycle wherever possible. The goal
is to have all components in your system only interact via protocols. This
way, you have established interfaces between components, and if you want to
swap an implementation, you just satisfy the p
If I have a stateful thing with a lifecycle then is the system component
the instance of the thing or a wrapper that contains the thing.
For example, let's say I have a registry of clients that want to be polled
then I might have the following:
(defrecord Registry [state])
(defn register-with [