home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!caen!sdd.hp.com!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.object
- Subject: Re: Object-Oriented Methodologies - Class Specifications
- Date: 3 Sep 1992 03:18:01 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 27
- Message-ID: <184059INNo85@early-bird.think.com>
- References: <BtyJK8.GFH@rice.edu> <j1kn6ll.objsys@netcom.com> <j8knsmd.objsys@netcom.com>
- NNTP-Posting-Host: gandalf.think.com
-
- In article <j8knsmd.objsys@netcom.com> Bob Hathaway <objsys@netcom.com> writes:
- >But the lack of default protection means no multiple-implementations per
- >type; a severe restriction that I doubt even CLOS' intercessory protocols
- >can overcome. Am I wrong here? Can CLOS provide for the separation of
- >types and classes (or any kind of multiple implementations per type)?
-
- While CLOS permits unrestricted access to slots (using SLOT-VALUE and
- WITH-SLOTS), it certainly doesn't force it, and it's generally considered
- bad style for non-methods to do so. For large scale protection, the
- package mechanism is recommended; among related classes within a package,
- abstinence is the safest way.
-
- CLOS makes it easy to define accessor methods for slots. Such methods are
- indistinguishable from ordinary methods, and can be overridden using
- DEFMETHOD in subclasses. WITH-ACCESSORS is provided as a convenience, so
- that you can pretend you're accessing these slots as variables, but you're
- still using the OO virtual function mechanism.
-
- So long as all functions outside the class implementation make use of the
- functional interface to slots, the separation of interface specification
- and implementation can be maintained.
-
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-