On Mon, May 21, 2012 at 1:59 PM, Mark Engelberg <mark.engelb...@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.
>

One of most complex OO component systems that I'm aware of - Cocoa -
doesn't rely on this kind of code reuse at all. Everything is done via
delegation and protocols.

Games are some of the most complex OO systems being built today and the
common wisdom is that building these systems on inheritance is a recipe for
failure:
http://www.gamasutra.com/blogs/MeganFox/20101208/88590/Game_Engines_101_The_EntityComponent_Model.php

Looks an awful like protocols, and if not protocols precisely - then
extend-type Object + sugar will get you the rest of the way.

So "real world" complex systems avoid inheritance like the plague. So
remind me again why it's desirable?

David

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