News for hackers. Stuff that matters.

new_account5648

Re:Why I'm Productive in Clojure (2013) on Sunday October 22, 2017 @07:11AM (#15526207)
I'm trying to evaluate clojure for standard enterprise applications. But I haven't seen anything on how to model entities and relations without a database:

   Entities:Person, Insurance, Car
   Relationships:
   Insurance--hasHolder-->Person(m:1)
   Insurance--insures-->Car(1:m)
   Car--hasPrimaryDriver-->Person(1:1)
   Person--drives-->Car(m:n).
   Additional constraint: hasPrimaryDriver(C,P) => drives(P,C).
The domain has cyclic relationships, hence I cannot model it as a tree. If everything is immutable, I have to update all entities that reference each other when replacing one?! What's the standard clojure way to implement it?