From: "Michael T. Richter" Date: 2008-05-29T19:47:38+09:00 Subject: Re: The duck's backside --=-kTuDq1L/8sppbj67qmiZ Content-Type: multipart/alternative; boundary="=-pF2dUYqRn6BX/xSWDhbf" --=-pF2dUYqRn6BX/xSWDhbf Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2008-05-29 at 07:23 +0900, Mark Wilden wrote: > One of the purposes of classes in OOP is to categorize things. One of the weaknesses of classic Booch, et al OOP is that one of the purposes of classes in OOP is to categorize things. Classes in classic OOP languages conflate a variety of concepts and cram them into one structure which does none of them particularly well: 1. Classes are the unit of state. 2. Classes are the unit of access control. 3. Classes are the unit of functional dispatch. In extreme cases (Java, I'm looking at you here!) classes are also the unit of packaging. (In other classic OOP language cases the unit of packaging is an ad-hoc mess. C++ I'm looking at you here!) I personally have always preferred the Dylan model (which I understand comes from the CLOS model, watered-down somewhat): 1. Classes are the unit of state. 2. Modules (and, to a point, libraries) are the unit of access control. 3. Generic functions are the unit of functional dispatch. (Multi-methods! Yay!) And, unlike Java or C++, libraries are the unit of packaging. I found that neatly layered structure of orthogonal concerns modelled by separate mechanisms a breath of fresh air after coming from the bizarre world of class OOP. --=20 Michael T. Richter (GoogleTalk: ttmrichter@gmail.com) When debugging, novices insert corrective code; experts remove defective code. (Richard Pattis) --=-pF2dUYqRn6BX/xSWDhbf Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, 2008-05-29 at 07:23 +0900, Mark Wilden wrote:
One of the purposes of classes in OOP is to categor=
ize things.

One of the weaknesses of classic Booch, et al OOP is that one of the= purposes of classes in OOP is to categorize things.

Classes in classic OOP languages conflate a variety of concepts and cram th= em into one structure which does none of them particularly well:
  1. Classes are the unit of state.
  2. Classes are the unit of access control.
  3. Classes are the unit of functional dispatch.
In extreme cases (Java, I'm looking at you here!) classes are also the unit= of packaging.  (In other classic OOP language cases the unit of packa= ging is an ad-hoc mess.  C++ I'm looking at you here!)

I personally have always preferred the Dylan model (which I understand come= s from the CLOS model, watered-down somewhat):
  1. Classes are the unit of state.
  2. Modules (and, to a point, libraries) are the uni= t of access control.
  3. Generic functions are the unit of functional dis= patch.  (Multi-methods!  Yay!)
And, unlike Java or C++, libraries are the unit of packaging.

I found that neatly layered structure of orthogonal concerns modelled by se= parate mechanisms a breath of fresh air after coming from the bizarre world= of class OOP.

--
Michael T. Richter <ttmri= chter@gmail.com> (GoogleTalk: ttmrichter@gmail.com)
When debugging, novices insert corrective code; experts remove defective= code. (Richard Pattis)
--=-pF2dUYqRn6BX/xSWDhbf-- --=-kTuDq1L/8sppbj67qmiZ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBIPonFLqyWkKVQ54QRAg7BAKDY41M3CWftXUceL4CpAdHbZZJ1LwCfTi3u OEr+SSxCNLei0KXqD7p/oyo= =/fTv -----END PGP SIGNATURE----- --=-kTuDq1L/8sppbj67qmiZ--