Better HN
topnewbestaskshowjobs
Log inSign up

new_account5648

1 karma · joined Oct 22, 2017 (9y ago) · 1 submissions

Submissions

comment 9y ago · link · parent

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?