My understanding of protocols is this: they are an abstraction representation of data. They allow you to write functions, building upon the protocol, such that they work for all concrete implementations of that protocol. So the protocol is a view on data. And the many ways of modifying the data is left out, and put in functions. Before defining a new protocol, I think it is a good idea to ask oneself if one could not just as well have built something out of maps, lists and vectors, and a set of higher-abstracted functions.
I hope these thoughts can inspire you to an improved design. On Fri, Oct 15, 2010 at 20:58, K. <kotot...@gmail.com> wrote: >> If your protocol functions generally look like : display that data on this >> view, then why not leverage multimethods and double dispatch ? > > I think I choose a misleading example, sorry about that. > > I'm working mainly with one kind of data, but there a lot of > functions. > For instance one function will display the search result, another will > notify the view of a particular change in the document etc. Data are > big so changes are done incrementally at the view level. That means > there is a function for each kind of change. Then a function for each > kind of listeners (I wanted to abstract the concrete listeners from > the controller) etc. Other functions are for setting a dirty marker > etc. There is merely only one view : the one used to edit the document. > > -- > 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 -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- 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