[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Law of good style for CLOS
- To: karl lieberherr <lieber@corwin.ccs.northeastern.edu>
- Subject: Re: Law of good style for CLOS
- From: kempf@Sun.COM
- Date: Wed, 01 Jun 88 07:32:27 -0700
- Cc: commonloops.pa@Xerox.COM
- In-reply-to: Your message of Sun, 29 May 88 05:36:32 -0400. <8805290936.AA06874@corwin.CCS.Northeastern.EDU>
- Redistributed: commonloops.pa
>As other man-made laws, the Law of Demeter allows room for
>interpretation. For example, if we interpret "immediate part" as
>the value of a slot which is declared for the given class (parameter
>specializer of first argument) and not a value of an inherited
>slot, we have a more restricted version of the Law (called the
>strong Law) which has been studied in some of Alan Snyder's papers
>on encapsulated software systems.
If a class is defined with accessor generic functions whose names are
exported from the package, but are different from the slot names,
which are not exported (or "hidden"), then the only access to the
slots is through a functional interface. From the client's point of
view, invoking a generic function on the object need not have any
relation to slot access at all, much less an inherited or noninherited
slot. This is an even stronger form of encapsulation, since the structure
of the class is now completely hidden. Of course, an inheriting client
may still want access to that structure.
jak