architecture

eoliphant 2018-05-01T14:40:29.000335Z

Hi, i’ve a question on spec and it’s ramifications architecture wise. I’m working on a ‘clojure all the way down’ system with clojurescript for frontends, clojure services and a datomic backend, and basically commands/events as the primary communication mechanism. I’m applying clean, etc principles to my services, isolating biz logic, yada, yada. I’m taking advantage of spec for data throughout, but I’m wondering about the potential tradeoff/issues in terms of coupling. While all the components are pretty loosely coupled and I just pass data around, that data is described by a common library of specs, that they all reference. It is pretty nice that say ::account-number is described and can be validated, etc. consistently everywhere, but I worry that this form of coupling may have some eventual downsides. Any thoughts on pros/cons/alternatives?

john 2018-05-01T14:53:45.000669Z

That's a keen observation. I think the core team have been encouraging folks not to over-spec-ify your systems.

john 2018-05-01T14:54:14.000306Z

There's some balance between too brittle and too generic

alexmiller 2018-05-01T14:54:28.000168Z

well this particular example does not seem over-speced

alexmiller 2018-05-01T14:54:48.000048Z

indeed, creating a single spec that can be validated on client and server is the whole benefit of using Clojure in your whole stack

donaldball 2018-05-01T15:23:37.000569Z

I would look hard to spec values that are passed between components and maybe the fns that produce and consume them, and not very much about specing the impl fns within each component.

👌 1
eoliphant 2018-05-01T17:12:23.000075Z

Thanks guys. yeah I’d been doing it already (client/server specs) in simpler apps. But now that this is graduating to a larger architecture, values flowing and all, just trying to think through the ramifications. and yes @donaldball to your point, I think the ‘internals’ for say service x, would be spec’ed if at all, with in that scope. These ‘global’ specs are really there for the data (attributes, messages,etc) I’ve just been making myself think through it as I went through the Canonical Data Model hell back in the day on several projects lol, but spec is a bit of a different animal