I was wondering what's a good way to use OO concepts in clojure. Just using multimethods and maps? Or maybe protocols? Let's say I write a program that deals with many graphical elements e.g. a game or a vector graphic editor. I could represent each graphic/sprite/shape etc. as a map and define multimethods to work with them. I could also use deftype to make each graphic an object. What are the advantages of each approach? Maps are more dynamic and allow me to use destructering. "deftype" objects give me better encapsulation of the properties and enforce the use of getter methods. Whether that's a good thing I'm not sure.
-- 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