Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!delmarva.com!newsfeed.internetmci.com!howland.reston.ans.net!nntp.crl.com!pacbell.com!amdahl.com!amd!amd.com!txnews.amd.com!news
From: "Paul G. Schaaf" <paul.schaaf@amd.com>
Subject: Re: Class side vs Instance Side??
Content-Type: text/plain; charset=us-ascii
Message-ID: <DEuv86.6s0@txnews.amd.com>
Sender: news@txnews.amd.com
Nntp-Posting-Host: hqsp86
Content-Transfer-Encoding: 7bit
Organization: Advanced Micro Devices
References: <4359i9$d6d@nuhou.aloha.net>
Mime-Version: 1.0
Date: Wed, 13 Sep 1995 17:57:40 GMT
X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
Lines: 51

reliance@paradise.net (Wardell Castles) wrote:
> I am new to OO and I think I understand Classes and Instances.  What I 
> don't understand is what is meant by Class side of the heirarchy and 
> Instance side of the heirarchy. If instances are instantiated from 
> classes why would not the heirarchy be the same?  

Think of a class as a factory that knows how to manufacture a specific 
type of object as you read the following:

pencin@netcom.com (Russell Pencin) wrote (in a thread on inheritance and 
the definition of the "new" method):
> ...
> My favorite example is automobiles ( in fact, Ford Taurus').  Let's 
> assume you want a Ford Taurus to drive around in.  Well, you have to 
> all the Ford Taurus FACTORY to have one built.  This is analogous to  
> sending the new message to the Class.  The main point here is that 
> FACTORIES have behavior that is different from the instances they 
> create. You could tell your Taurus to accelerate, turn, stop - however 
> these messages would be relatively meaningless to the Taurus FACTORY 
> (Class).  You could tell the FACTORY to build a new Taurus (new) or ask 
> it the default engine size, or the default tire type, etc., again these 
> would be relatively meaningless to the individual Taurus.
> ...

Let's say that "FordTaurus" is a subclass of "Automobile".

Class methods are those understood by the factory itself.  Inheritance 
along the "class side" of the class hierarchy provides a way of defining 
a new factory in terms of an existing one.  E.g. The FordTaurus factory 
manufactures FordTaurus's just like the Automobile factory manufactures 
Automobile's.  Class methods of FordTaurus are used to supplement or 
(only slightly) correct any of that default behavior.  


Instance methods are those understood by the instance, inheritance along 
the "instance side" of the class hierarchy provides a way of defining a 
new instance in terms of one that would be manufactured by the 
superclass.  E.g. a manufacturED FordTaurus operates just like a 
manufactured Automobile.  Instance methods of FordTaurus are used to 
supplement or (only slightly) correct any of that default behavior.  

I hope this information is either helpful, or makes sense, or both.

----------------------------------------------------------------------
Paul.Schaaf@AMD.Com              Advanced Micro Devices, Sunnyvale, CA
I don't speak for my company                        http://www.amd.com

"In theory, there is no difference between theory and practice, but in
 practice, there is." - unknown


