Hi Joachim

The component lifecycle protocol is used to group together the init, start
and stop functions tied to ephemeral services common to many Java
server-side applications. I'm not sure it makes sense for components to
satisfy other protocols that are functional in nature, as this invite
coupling of concerns. The intention is that component functions
inject/reject state into/from the system map. Your suggestion of retaining
a JDBC connection under [:jdbc-component :db] is exactly what Jig intends.
Clojure applications should, as far as possible, avoid state. But when
applications need to retain state, they should do so in a system map that
is continually subject to repetitive creation and destruction, if only to
avoid the detrimental effect that stale state can have on the speedy and
iterative development of applications.

I have toyed with the idea of adding core.async protocols and
provides/requires metadata to components, but none of my approaches have
felt satisfactory. I think it's better to keep components as lightweight as
possible, letting them setup and teardown state within the system map, and
with that as their single responsibility. (However, if you have alternative
suggestions, do let me know)

Regards,

Malcolm


On 22 January 2014 22:22, Joachim De Beule <joachim.de.be...@gmail.com>wrote:

> (follow up)
>
> I just realized that another approach would be to hold the jdbc connection
> type implementing the JDBCProtocol in system under [:jdbc-component :db] or
> something, and then call the clojure.java.jdbc/query like functions on
> that. Anyway, I would be very happy to hear your comments on this!
>
>
> --
> --
> 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/E0BdR_AksiA/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/groups/opt_out.
>

-- 
-- 
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/groups/opt_out.

Reply via email to