On Fri, Oct 17, 2014 at 12:47 PM, Rui Yang <ryang....@gmail.com> wrote:
> I am new to clojure. > > My question how to handle version if we expose data directly as api, any > schema change will break the api which may impact third party users. > You can't protect the consumers of your API. You publish your new API and pray. As a consumer I do TDD. So my code is fully tested. Of course most of the 3rd party code is mocked in my tests. When I upgrade a dependency I read the changelog and run my code to see if anything breaks. Clojure is a dynamic language, so there's actually no schema. I suppose I can write integration tests and such... But I doubt they'll be able to catch everything. My point is; as a producer (of libraries) there's little you can do within your code. As a consumer you can do a bit more. > > On Friday, 17 October 2014 15:23:10 UTC+11, Armando Blancas wrote: >> >> Sure, that's the theory behind encapsulation, but I'm not convinced there >>> are many cases in practice where the API can remain consistent while the >>> data changes. >>> >>> >> >> I'm not, either. Models that have little or no abstraction --basically >> aggregates of related items-- end up having APIs that just reflect their >> contents. For years, my tools were the Eclipse refactoring features and the >> code (re)generation of the Eclipse Modeling Framework, not encapsulation. I >> started using Clojure practices, though not totally convinced until a while >> ago Stuart Sierra wrote: "The data *is* the API," which helped me >> understand what I was really doing. Whereas I never faced the proverbial >> computed-field change, I've now taken good advantage of generic functions >> over maps and records. >> > -- > 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. > -- Kind Regards, Atamert Ölçgen -+- --+ +++ www.muhuk.com -- 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.