English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
RE: [Caml-list] Some Clarifications
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-07-27 (13:51)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Some Clarifications
On Wed, Jul 27, 2005 at 04:55:32AM -0700, Robert Roessler wrote:
> An object certainly seems a natural and concise way to represent a 
> "state-holder-with-structured-access" - and I have done just that in a 
> small OCaml project... but that could be the Smalltalk and C++ in my 
> background talking. :)

Modules actually work better for this.

The exception is for GUIs, where inheritance allows you to do a few
minor but useful things - in particular having containers and layouts
which can contain widgets of any widget type.  It's interesting that
the one example of OO design in the GoF book (or in my ancient edition
of it at least) is GUI widgets.  I'm keen to know if there are any
other areas where inheritance is actually useful over straightforward
polymorphism and higher-order functions..


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com