Hacker News Comments on
Domain-Driven Design with Clojure
Amit Rathore
·
InfoQ
·
51
HN points
·
1
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.Here is an example that I'm quite partial to:Presentation - https://www.infoq.com/presentations/DDD-Clojure/
Code - https://github.com/zololabs/zolodeck
Its a Domain-Driven/Hexagonal Architecture codebase written in Clojure. Its not uncommon to see this sort of approach in Java/C# so it makes comparisons of the code relatively easy.
While the overall code layout is the same as what you'd see in Java/C#, a big distinction is that the "entities" that make up the core functionality of the domain in the Clojure version are simple data structures (rather than classes), and the logic that operates on them are pure functions (rather than methods on the classes themselves).
With this approach, a lot of the hoops you'd usually jump through with dependency injection to enable testability go away, since its easy to test pure functions that operate on simple data structures, no mocking required.
This sort of approach isn't limited to Clojure [0], but Clojure makes it idiomatic.
⬐ nickikClojure/Datomic/Storm seams like a very powerful combo. Im exploring pedastel right now, that would be another 'next level'-tool.It seams to me that both Datomic and Storm are kind of leaf behind the standard way of doing the same things. So does pedastel (I dont really know much about Storm but it seams that way).
⬐ sgrove⬐ rdudekulCurious what you mean by "kind of leaf behind the standard way"? We've been pretty impressed with storm, and are cautiously eyeing Datomic (the closed-source community makes us pretty cautious to rely on it too heavily).Similarly, the ideas behind pedestal are intriguing, and while we won't likely switch into it wholesale without a much better understanding, we would love to curb some of their techniques.
⬐ nickikWhat I mean is that there are these standard ways that actually held fast for quite some time. The big change between old school perl/php and new and cool ruby/python was mostly the ORM.It was standard that you had some scripting language behind that some mysql. I used to do ASP classic, and from there to Django the diffrence is there but its not as radicle.
With datomic and pedastal the hole way I tought about web programming changes. Im not arguing that all these things are better then what we used to have, but just that the threw over my hole thinking.
Im trying to develop a simple boardgame that you can play online against each other. Normally I would just go in standard dev mode and it would be pretty clear what to do. Now that Im doing it wiht Datomic and Pedastal im constantly thrown off. How would you do this? Is that idiomatic?
> Datomic (the closed-source community makes us pretty cautious to rely on it too heavily)
Yeah I can see that. I kind of think that as people learn more about Datomic somebody will start a opensource implmentation of it.
The talk is very interesting, since it shows how functional languages can be used for creating traditional enterprise apps. There is a gap in OO developers minds in terms of adopting functional programming (FP) and how to organize larger projects. Amit Rathore, author of the book The Joy of Clojure, does a great job in presenting a simple way of applying DDD principles to FP and thinking about organizing FP code that scales team productivity.⬐ fb1He is the author of Clojure in Action