On Mar 2, 8:34 pm, Sophie <[email protected]> wrote: > Do I design a single "World" ref whose state changes with time to > different worlds, so adding a new Applicant or even adding a new Skill > to an existing Applicant results in a new World value? Or is it better > to have an "Applicants" ref and a "Jobs" ref that refer to different > sets of those er.. things? >
It's simpler to use refs close to the object that will change; that makes the code to mutate the value simpler; if the world is the only mutable object, then the code to change something in there will increase with the depth of the mutation. > Can each Applicant have a "skills" ref, whose state changes to > different sets of Skills? Should I design it this way? Yes; and if the kills set in independent of other state it may be an atom and you avoid a dosync if the program is single-threaded. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
