On Mar 2, 11:34 pm, Sophie <itsme...@hotmail.com> wrote:
>
> How do I choose? What are the trade-offs?
>
> Any and all guidance, insights, advice etc. welcome!
>
> Thanks!

To me, it seems like you have two orthogonal pieces of data, and a
function that builds a report from that data.  You have a set of job
listings, and a set of applicants.  I see no reason why these need to
be coordinated (ref).  The addition of a job listing is totally
independent of an applicant updating her resume.  So it's
uncoordinated (atom).  That is, the job listings are always in a
consistent state no matter what I do to the applicant data.  Said
another way, there's nothing I can do to the applicant data that can
put the job listings in an inconsistent state.

As for the match function.  Well it needs to get a snapshot of both
pieces of data, and then determine what applicants match up with each
job listing.  While this function is running a job could be added, an
applicant could update her resume, or maybe an applicant will remove
her resume but your function won't see any of that, but who cares?  It
will see a consistent snapshot of both pieces of data, and from those
it will build the result.  As of time T1, here is your latest and
greatest match report.

Now, say you want the match report built every time a job listing or
applicant data is changed.  This way the 'latest' report is always in
memory and ready to go.  Well, in this case, you now need to
coordinate the update of job listings or applicant data with the
generation of the report.  You never want your program to enter a
state where the job listings are in state L101 and applicants are in
state A54 and your report is based on the combination of (L101, A53).
That's an inconsistent state because your report is not based on the
latest data.  In this case, you'd probably want to use refs to make
sure the your job/applicant data is coordinated with your report
data.  However, if your data is constantly changing, and the match
function takes a while to run then this may be very slow.

Take what I say with a grain of salt as I'm also fairly new to this
stuff.  At the end of the day, experience is probably the best
teacher.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to