Path: utzoo!utgpu!watmath!clyde!att!rutgers!mit-eddie!uw-beaver!cornell!batcomputer!itsgw!steinmetz!uunet!portal!cup.portal.com!dan-hankins
From: dan-hankins@cup.portal.com (Daniel B Hankins)
Newsgroups: comp.lang.misc
Subject: Re: object oriented design decision
Message-ID: <12096@cup.portal.com>
Date: 4 Dec 88 03:35:39 GMT
References: <4086@enea.se> <11522@cup.portal.com> <12636@steinmetz.ge.com> <10660@tekecs.TEK.COM> <737@quintus.UUCP>
Organization: The Portal System (TM)
Lines: 33

In article <737@quintus.UUCP> pds@quintus.uucp (Peter Schachte) writes:

>I think a similar approach could work quite well, though, if it were
>built into the OO system.  It would have to understand attributes, like
>propulsion in the above example.  An attribute would be like a class,
>except that they can't be instantiated, and a class can specify that
>certain attributes must be specified when it is instantiated.  So vehicle
>would be a class that requires propulsion, which would be an attribute
>(sort of like a mixin, for flavors people).  An attribute specification
>would include a set of methods that its instances (this is probably a
>bad choice of word -- in this case I mean motorized and non-motorized)
>must supply.  When an instance of vehicle it gets all the methods from the
>vehicle class, plus the methods from the chosen attribute.  But it's
>still a single object.
>
>I hope I'm being at least faintly clear.

     I had to think about this one for a while.  For a while I thought it
was the same as multiple inheritance.  But I can see that it has potential
for a more natural expression of an object description.  Objects are
like nouns, messages/methods are like verbs, and attributes are like
adjectives and adverbs.

     However, your description is a little confusing.  Could you possibly
append an example of a class definition using attributes, and an example of
an attribute definition?

     Also, how do you get attributes to work together?  How do you get them
to agree on variable names which are meant to be shared, such as for
example vehicle position?


Dan Hankins