On Thursday, April 26, 2012 4:36:52 PM UTC-4, David Nolen wrote:
>
> On Thu, Apr 26, 2012 at 4:30 PM, blais <goo...@furius.ca> wrote:
>
>> (Generally I find I get too little "cultural osmosis" when it comes to 
>> practical application of Clojure, so questions like this one come up all 
>> the time while I'm coding. Meetups and books touch on topics I understand 
>> well but rarely do people talk about the kinds of issues I'm encountering, 
>> like the one above. Libraries and other people's code often doesn't help 
>> all that much because it's fairly easy to do away with mutability in a 
>> library context.  I'll just read more OPC for now I guess.)
>
>
> Do you need to represent your data with that much nesting?
>
> (def m {:planet ...
>            :country ...
>            :state ...
>            :city ...
>            :borough 4})
>
> What's wrong with this representation?
>
 
Well this was just to simplify my original question; the real application 
has a root instance that is a networked application class, which contains 
some list of clients, each of which has a mapping of orders (per exchange / 
market, this is a trading application) which themselves map to events 
related to those orders.  So it's more like "application -> client-handler 
-> feed -> market -> order-id -> event".  These aren't necessarily "pure 
data" classes--some of these may be records with implementations of 
protocols. 

I suppose I could elect to move refs for modifiable things towards the 
leaves, but that seems to me like going against the grain and may have 
implications for concurrency (there are few but some threads running in 
parallel in this application).  In this specific example of an application 
tree, where would you recommend the mutable objects be placed?

Thanks,

-- 
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