On 15 September 2016 at 20:50, Cameron Barre <cjba...@gmail.com> wrote:

> Has anyone used protocols to create explicit boundaries between the bigger
> pieces of their systems? We want to track/control the interactions between
> these sub-systems and are considering using protocols to define public
> APIs. Is this good practice? Would it be better to simply create our API
> like a normal library and be explicit about which functions are part of the
> public API?
>

Protocols are a mechanism for polymorphism. If you need polymorphism, use a
protocol, if not, then don't.

Protocols can be useful for defining an external boundary, such as an
interface to a service. In this case it's useful to have polymorphism so we
can substitute different services, or use mock services for testing.

- James

-- 
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.

Reply via email to