From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: enikitin@apk.net (Eric W. Nikitin) Subject: Re: OO, C++, and something much better! Date: 1997/02/21 Message-ID: <5eka6l$bv1@nerd.apk.net>#1/1 X-Deja-AN: 220416240 Distribution: inet References: <5bphq4$5js@mulga.cs.mu.OZ.AU> Followup-To: comp.lang.eiffel,comp.lang.ada,comp.lang.c++,comp.lang.smalltalk,comp.object Organization: Akademia Pana Kleksa, Public Access Uni* Site Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c++,comp.lang.smalltalk,comp.object Date: 1997-02-21T00:00:00+00:00 List-Id: Chris Bitmead (Chris.Bitmead@Alcatel.com.au) wrote: : In article rmartin@oma.com : (Robert C. Martin) writes: : : >This statement is oxymoronic. A type is defined by the interfaces it : >accepts. There is no other definition of a type. Thus, the statement : >above could be translated as follows: : : Not true. There are other definitions of type. : : For example, in some languages we could have a "ball" class and a : "cat" class, both of which respond to the message "kick", yet there is : no explicit "kickable" class. The "problem" here is that in languages like C++, the class construct provides: - a mechanism for encapsulation - an object's structure - an object's behavior In languages like Oberon-2 ( and I am fairly certain like Ada as well ), these concerns are modeled by separate language constructs. Encapsulation is provided by modules, structure comes from the type mechanism, and behavior is described by dynamically-bound procedures. A language derived from Oberon, Lagoona, goes on to provide an additional feature called categories which are distinct from type, but allow different types to be related via similar behaviors. ( Categories are similar to protocals in Objective-C and interfaces in Java ). A cat has a very different structure from a ball. And yet, if I am in the mood to kick something, and am not particular about what I am willing to kick... each could be a member of the category "kickable". Class is a broader term than type. From _The Annotated C++ Reference Manual_ (c) 1990, classes contain "a sequence of objects of various types, a set of functions for manipulating these objects, and a set of restrictions on the access to these objects and functions". : So, while you might argue that conceptually there is a "kickable" : type, nobody does this in practice, because it could lead to an order : of magnitude increase in the number of "types" identified in a system. It depends. If "kickable" is a useful abstraction, then it should be modeled. -- Eric --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Those who know that they are profound strive for clarity. Those who would like to seem profound to the crowd strive for obscurity. He is a thinker; that means, he knows how to make things simpler than they are... - Friedrich Nietzsche ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~