r/Clojure • u/tanrax • 10d ago
Implementing Clean Architecture in Clojure
https://en.andros.dev/blog/bebb6f27/implementing-clean-architecture-in-clojure/
30
Upvotes
r/Clojure • u/tanrax • 10d ago
View all comments
1
u/yogthos 10d ago
I find that clean architecture is only a part of the bigger picture because keeping IO strictly at the edges is not practical in many scenarios. Often, you simply don't know what data you're going to need later, and fetching everything up front is inefficient.
So, the way I've started thinking about this is that you can structure the application as effectively a graph of small components that each take resources and the state, do some task and return a new state that then gets dispatched to the next node in the graph. This way each node can be structured using Clean Architecture with effects at the edges, and then data can be loaded as needed when the state transitions to a new node in the graph. I wrote about this approach in some more detail here.