I think the "right" (or maybe idiomatic is a better word) organisation is an effect of a very important cause - changing the way you think about a software system. Simplistically, OO promises to be a world full of chunks of knowledge and behaviour that politely ask other chunks to behave in a certain way. You have relatively narrow but very deep 'shapes' as levels of abstraction increase. Realistically we all know how that goes :).
In FP the form the structure of the knowledge itself is your primary chunk with a many little chunks of functionality that all know how to transform one shape to another. You have a relatively wide and shallow 'shapes' that all work on a few core chunks of knowledge (i.e. state). To put it another way, I find it really helpful in Clojure to phrase the question 'what shape data do I need and which transformations are necessary'. It isn't quite on its head, but close. You can absolutely still address encapsulation, domain abstractions etc. (http://thinkrelevance.com/blog/2009/08/12/rifle-oriented-programming-with-clojure-2) but start with the shapes of knowledge. All of the above is incredibly simplistic, 'wrong' for some definition of wrong but it is something I wish somebody had told me when I was first starting out :). On Monday, 3 February 2014 08:47:09 UTC, Aravindh S wrote: > > Hi All, > I am new to clojure and have been working with the language for the > past one week. I have got a basic hold of the constructs in clojure. I have > been programming for 4 years in C# now. One thing I am not able to > comprehend is how clojure programs are structured. In an OO world, I know > what are the entities that the program should have, how they will be > related etc. I am not able to do the same wit clojure. I agree that words > like classes, methods dont make much sense in functional programming. I am > precisely looking for a program written in clojure ( A medium level program > say about 200 - 300 LOC) which clearly tells how a problem domain should be > approached in a functional manner using clojure, how the functions should > be organized. A specific solution for specific problem will be helpful. > > > Thanks > Aravindh.S > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.