21 May 23:21
Re: defrecord with "inheritance"
Warren Lynn <wrn.lynn <at> gmail.com>
2012-05-21 21:21:49 GMT
2012-05-21 21:21:49 GMT
Sometimes it seems to me"OO" and "inheritance" have become some kind of taboos. I don't believe OO is all that wrong. To me Clojure seems to have good potential to harness the good part of OO without carrying into the bad parts. So I am hoping.(Continue reading)On May 21, 2:25 pm, "nicolas.o...@gmail.com" <nicolas.o...@gmail.com> wrote: > >> On the other hand, defrecord/deftype encourage you to write your protocol > >> implementation in a way that cannot be reused unless you very specifically > >> plan for it (factoring the protocol implementation into a separate map) and > >> use a coding style that (might?) be less efficient (i.e., adding the > >> protocol implementation via extend rather than directly in defrecord). This > >> is not so good and potentially limits the value of protocols for developing > >> complex systems. > > Inheritance is bad because it ties code reuse to a (mostly) > non-significant hierarchy. > That is not a reason to prevent all code reuse from deftypes. > > (It is not because OO gets it wrong that we should not try) -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure <at> 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+unsubscribe <at> googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
On May 21, 2:25 pm, "nicolas.o...@gmail.com" <nicolas.o...@gmail.com>
wrote:
> >> On the other hand, defrecord/deftype encourage you to write your protocol
> >> implementation in a way that cannot be reused unless you very specifically
> >> plan for it (factoring the protocol implementation into a separate map) and
> >> use a coding style that (might?) be less efficient (i.e., adding the
> >> protocol implementation via extend rather than directly in defrecord). This
> >> is not so good and potentially limits the value of protocols for developing
> >> complex systems.
>
> Inheritance is bad because it ties code reuse to a (mostly)
> non-significant hierarchy.
> That is not a reason to prevent all code reuse from deftypes.
>
> (It is not because OO gets it wrong that we should not try)
RSS Feed