[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
The Law of Demeter
- To: CommonLoops.pa@Xerox.COM
- Subject: The Law of Demeter
- From: John D. Berger <john%linus@mitre-bedford.ARPA>
- Date: Fri, 24 Jun 88 11:14:45 EDT
- Posted-date: Fri, 24 Jun 88 11:14:45 EDT
- Posted-from: The MITRE Corp., Bedford, MA
- Redistributed: CommonLoops.pa
Concerning the Law: You say that function calls inside a method M
should use only certain objects as method selection arguments.
How does the programmer know what arguments a function will use to
dispatch according to type? How does the programmer know that a
function is generic and will do such a dispatch?
You say the Law prohibits functional composition of accessor functions
which return non-slot objects.
How does the programmer know that a function-call is a slot-access?
You say it's okay to use objects that are created by the method in
question, or by a function that it calls.
How does the programmer know that an object returned by a function is
newly-created?
It seems that in order to use the Law, the programmer must have
knowledge which violates an even older law: That of information-hiding.
-john