Professor Baclawski has the following feedback to the Law of Demeter for C++: Karl, I am a little puzzled by your statement of the Law of Demeter in terms of C++. You refer to member functions as being "attached to" a class. While I can understand what you might mean by this, it is not a C++ term. member functions are declared as members and then defined. They are not defined and then attached to a class. You also speak about a member which "sends a message". I don't know what this could mean. Neither "sending" nor "messages" are C++ terms. Thanks, -- Ken Ken is right; we have to formulate it in C++ terminology: OLD FORMULATION: ----- LAW OF DEMETER (C++, object version) ------------- In any member function M defined for class C only send messages to the following objects: - M's argument objects, including the object pointed to by "this" - a data member object of class C. (Objects created by the member function, or by functions which it calls and objects in global variables are viewed as being passed by arguments.) ---------------------------------------------------------- NEW FORMULATION: ----- LAW OF DEMETER (C++, type version) ------------- In any member function M defined for class C only call member functions of the following classes: - M's argument classes, - data member classes of class C. (Objects created by the member function, or by functions which it calls and objects in global variables are viewed as being passed by arguments.) ---------------------------------------------------------- It is interesting to notice that for C++ it is easier to give the type version, since C++ is strongly typed. Ken, how do you like this formulation? -- Karl