π I am Felippe from Brazil and currently living in Sandy/UT/USA, 34 YO, married and father of Nico (6 YO) and Esme (2 YO). Been working with python, java, js, ruby for the past 15 years and now finally clojure. I am trying to learn more about kit and pedestal, particularly as it relates to hexagonal architecture. The thing I donβt get right now, in clj land, is how to think about entities that are not closely coupled with a db table, or an external API representation β essentially how to define domain entities and βuse casesβ that describe the business logic. I would appreciate any help with that π
Hi @raposo.felippe, welcome!! Nice to see more Brazilians here ... please feel free to join #clojure-brasil π
π from Lindon, UT
Domain entities are generally "just maps" -- plain ol' immutable data.
Business logic is "the same", except we try to keep it all pure -- so it gets all of its input via arguments and returns the "modified" data. Search for "functional core, imperative shell" for example.
Hi mr.Corfield, thank you so much for the prompt response. Are you aware of any public codebase that follows the concepts you mentioned? Thanks!
Not off-hand, I'm afraid. I mostly only pay attention to OSS libraries, not apps.
Hello Felippe, take a look at https://github.com/soulspace-org/overarch. It is a command line app for modeling system architecture and is designed with clean/hexagonal/onion architecture. The model elements are just plain data and the domain core is purely functional. The application layer contains the "use case" orchestration and the "interfaces" (multimethods here) for the driven adapters (e.g. for exports and rendering), for which the implementations are in the adapter layer.
Welcome! If you haven't already, feel free to join #pedestal, #kit-clj, and #architecture and ask questions there too.
Thanks everyone π
If you are interested in the Hexagonal architecture, you should read https://medium.com/@joakimtengstrand/understanding-polylith-through-the-lens-of-hexagonal-architecture-8e7c8757dab1 blog post, where I compare it with Polylith.