Browse thread
[Caml-list] Delegation based OO
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Kenneth Knowles <kknowles@b...> |
| Subject: | Re: [Caml-list] Delegation based OO |
On Wed, Mar 24, 2004 at 11:43:48AM +0100, Alex Baretta wrote: > Delegation is no relative of inheritance. Inheritance is a syntactic > property (essentially classes inherit code), whereas delegation is a > semantic property: once one method is delegated by a proxy object to an > executor object, the the visibility of the proxy is lost. The method is > executed as if it were invoked directly on the executor. I disagree with the "syntactic" vs "semantic" distinction, but the message that they are different animals is exactly my point as well; I contrast the two because previous messages had compared them (mention of "overriding"). The debate seems to really be about which methods should be delegated, which is easily regulated by typing. "delegate x to y" could be "delegate (y :> x)" so you avoid yet another language construct. Most of the time I would expect this to actually occur like so: class foo (del : delegate_class_type) = object delegate del (* Don't need any type annotation or "to" keyword here *) end Kenn ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners