architecture

jaihindhreddy 2018-09-28T15:09:12.000100Z

Is there an open source clojure implementation of ports and adapters or hexagon architecture or clean architecture I can check out. How would you go about designing such a system?

polymeris 2018-09-29T14:38:32.000100Z

To me, ports and adapters seem like something you need to escape OOP, and think that in clojure something similar should be possible with a simpler model, e.g here my "ports" are just keywords: https://github.com/polymeris/edos

jaihindhreddy 2018-09-29T15:59:39.000100Z

Thank you guys. @drewverlee I did read Joy of Clojure. @polymeris edos looks interesting. A bit macro heavy for my taste. But interesting.

polymeris 2018-09-29T16:00:12.000100Z

Yeah, it's just an experiment. I think a better approach would be more data-driven

✔️ 1
polymeris 2018-09-29T16:01:03.000100Z

This is another talk that touches on the same topics: https://www.youtube.com/watch?v=WtdegIqQbrg

polymeris 2018-09-29T16:02:01.000100Z

The whole talk is interesting, but you can skip to 15m to see how they handle "commands" and isolating side-effects

jaihindhreddy 2018-09-29T16:02:02.000100Z

Did watch that one. That's what started me to really think about how ports and adapters would combine with state machines to give us a framework to organize code

polymeris 2018-09-29T16:03:20.000100Z

I am sure there is a lot of research an experimentation to be done.

polymeris 2018-09-29T16:04:19.000100Z

Let us know if you come up with interesting ideas!

jaihindhreddy 2018-09-29T16:07:02.000100Z

Will do!

2018-09-29T17:25:44.000100Z

Well, from my quick read of the pattern, I would say the goal is to increase the understandably of the code base though separation of concerns. That idea is applicable in clojure as well. I wouldnt conflate business rules with http calls for example.

2018-09-29T17:27:55.000100Z

The difference in implantation would be that where in oop, your encouraged to see your objects as data stores, the clojure community would suggest maps or possible datomic or datascript to hold the information

2018-09-29T17:30:07.000100Z

So your http call might return a resp, then a validation, then a conversion fn to the business domain, then this data can enter the business domain api

jerger_at_dda 2018-10-09T16:37:38.000100Z

At https://github.com/DomainDrivenArchitecture we do DDD with clojure. Aggregation, validation and bounded contexts are working quite well to us (way smarter than OO :). We're very interested in discussing functional-DDD adoption 🙂

socksy 2018-09-28T23:17:13.000100Z

@jaihindh.reddy Jan Stępień gave talks about a similar design pattern in clojure https://www.youtube.com/watch?v=0EX3UIl-Sd8