Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!gatech!news.sprintlink.net!mv!usenet
From: rapp@lmr.mv.com (L. M. Rappaport)
Subject: Re: Smalltalk terminology - Object, Class, and Instance
Message-ID: <DAsuBL.9Ir@mv.mv.com>
Nntp-Posting-Host: lmr.mv.com
Sender: usenet@mv.mv.com (System Administrator)
Organization: MV Communications, Inc.
Date: Tue, 27 Jun 1995 00:28:25 GMT
References: <3shvfp$l9k@portal.gmu.edu>
X-Newsreader: Forte Free Agent 1.0.81
Lines: 50

mtran2@osf1.gmu.edu (My-Phuong L Tran) wrote:

>I am very confused by the meanings of these three important terms in ST.
>To give an example of the difficulties I would like to quote from a
>typical book on Smalltalk, 'An Introduction to Object-Oriented
>Programming and Smalltalk', by Lewis J.Pinson and Richard S.Wiener,
>which by the way is *fantastic*.

>(1) from p.34, "Objects are instances of a particular class."

An object is an instance of a class.  The word "instance" may also be
substituted for the word "object"
 
>(2) from Appendix 1, p.431, "In Smalltalk, everything is an object."

Yes, ST programming is essentially sending messages to objects.  That
isn't to say that you can't define your own classes and instantiate
your own objects from them, but technically, when you create your own
class,  I believe you are essentially sending messages to the
metaclass object to create a class, so even that is the same thing.
(I may have that wrong, it always confuses me :) )

>(3) from Appendix 1, p.431, "A class is an object that defines properties
>  for specific kinds of objects."

For a beginner, this can be really confusing.  To understand it, you
have to realize that even a class can be an object.  A class is an
object (or instance, if you prefer that word) of the metaclass
'class'.   Best thing at this stage is to just ignore metaclasses
until you are more familiar with OO.  Hey, works for me!

>(4) from Appendix 1, p.432, "An instance is an object of a specific class."

Yeah, he's just saying that an object == an instance of a class.
Instance and Object are often used interchangeably.

>Can anyone make sense of this?  Are two different meanings to 'object'
>begin used, as for example in (1) compared to (4)?

There is no difference.  Just two ways of saying the same thing.

Larry
--


--------------------------------------------------------------
L. M. Rappaport & Associates, Inc.       Voice +1.603.237.8400
P. O. Box 158                            Fax   +1.603.237.8430
Colebrook, NH 03576                      CIS   72427,2567

