4 ms·
Yes, the point of the article is that people should do this (as is common in Clojure) rather than try and encode the rules in the type system (be it as a class
by sirwhinesalot 1y ago
Yes, the point of the article is that people should do this (as is common in Clojure) rather than try and encode the rules in the type system (be it as a class hierarchy or a sum type).
- GiorgioG 1y agoSo (I don't know Clojure) - is the author saying everything should be a map/dictionary? That sounds like complete chaos - I'm not an OOP proponent.
- sirwhinesalot 1y agoYes and no. The core point is that business rules should be encoded as functions, not in the type system. Everything ending up a map is a side-effect of that since the functions need somewhere to store the information. But a map is also just one solution. You could use a fat struct as well, or implement a ad-hoc relational database (like what entity component systems really are)