Xref: utzoo comp.object:3383 comp.lang.eiffel:1548 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!mucs!cs.man.ac.uk!mario From: mario@cs.man.ac.uk (Mario Wolczko) Newsgroups: comp.object,comp.lang.eiffel Subject: Re: Unification: Class=Type=Module Message-ID: <2462@m1.cs.man.ac.uk> Date: 27 Apr 91 14:04:47 GMT References: <1991Apr23.142800.12215@bony1.bony.com> Sender: news@cs.man.ac.uk Reply-To: mario@cs.man.ac.uk (Mario Wolczko) Followup-To: comp.object Organization: Department of Computer Science, University of Manchester Lines: 37 In article <1991Apr23.142800.12215@bony1.bony.com>, richieb@bony1.bony.com (Richard Bielak) writes: > > One of the things I liked about "Object Oriented Software Construction" > by B. Meyer, was the idea that a class is both a type and a module. > This idea clears up the confusion as to whether inheritance extends or > specializes. ... > I also like the "cleanness" and simplicity of this idea. I also like this idea, but unfortunately no existing object-oriented language (to the best of my knowledge) supports it properly. Eiffel, Smalltalk and CLOS all go only half way; C++ is a little better, but still short of the mark. For a class to be a module it should have a clear separation between interface and implementation, such that any compatible reimplementation can be substituted without affecting "users" of that class. That's what module means: you can swap compatible modules with impunity. When the "user" is a client class, most if not all OO languages succeed in hiding implementation, but when the "user" is a subclass, they fail miserably. For example, all of Smalltalk, Eiffel and CLOS allow direct access to all inherited instance variables, so that no part of the internal representation can be hidden. In contrast, C++ lets you declare an instance variable (member) to be private. In none of these languages can you isolate a class from the choice of superclasses made by its parent(s). Mario Wolczko ______ Dept. of Computer Science Internet: mario@cs.man.ac.uk /~ ~\ The University uucp: mcsun!ukc!man.cs!mario ( __ ) Manchester M13 9PL JANET: mario@uk.ac.man.cs `-': :`-' U.K. Tel: +44-61-275 6146 (FAX: 6236) ____; ;_____________the mushroom project___________________________________