Fork me on GitHub
#architecture
<
2022-12-01
>
Jimmy Alejandro Alvarez Calderon13:12:08

Hi, Currently I'm. woring in a feature that calculates some information about payments. The situation is that we have the calculation logic already implemented, but, we think we do no have to rely on where the information required for the calculation comes from. based on that constrain, we came up with the idea of having some sort of repository pattern where basically maps an input to a domain model without creating a coupled dependency from where the data comes from. I was investigation on how to accomplish this in clojure and came up with https://clojure.org/reference/protocols and https://clojure.org/reference/multimethods which for me it looks good with what we need. However, I would like to know what are your opinions of using this clojure feature in the community, is this commonly used?, what was your experience using it? or any tip you can provide so I can assess better my implementation shoot.

2
timo13:12:42

Both are heavily used in clojure

adi08:12:33

> we came up with the idea of having some sort of repository pattern where basically maps an input to a domain model without creating a coupled dependency from where the data comes from Well, this is exactly the design constraint I adopted, in my take on the "Mars Rover" problem, using domain-as-data, and multimethods, and a calculator at the heart of it all... It is a small piece of code containing a bunch of design ideas that a team can review and discuss in half a day: https://www.evalapply.org/posts/clojure-mars-rover/

adi08:12:29

@U036F18PTD2 see if it helps, as a companion post to Chas's post that Sean linked above.