Erann: Here is my current view of Smyth's Law of Demeter and its relationship to the original LoD: The LoD is well defined in our papers. There are different versions, like the object and class form and the strong and weak form. A good short summary of the weak object form is (quoting Smyth): > A method shall act only upon the arguments and the pre-existing > state of the object. The LoD can be applied to many different languages: There is a LoD-CLOS, LoD-Java, etc. We can also apply the LoD to multi-threaded languages without return types and this combination seems to be very useful for distributed/parallel/multi-threaded systems. The application of the LoD to multi-threaded languages without return types I call Smyth's Law of Demeter. Does this clarify the situation? -- Karl >From gat@aig.jpl.nasa.gov Mon Jun 2 13:22:47 1997 >Date: Mon, 2 Jun 1997 10:22:30 -0700 (PDT) >From: gat@aig.jpl.nasa.gov (Erann Gat) >To: lieber@ccs.neu.edu >Subject: Re: LoD and return values > > >> You are right: >> >> "essential" was not the right word below. >> >> "convenient" would be better. > >This still doesn't resolve the apparent conflict. Smyth's position is >that returns values are the moral equivalent of a goto -- something to >be avoided at all costs. Your modified position, that return values are >"convenient", still seems at odds with this. On your view, return >values are acceptable in good code; on Smyth's view they are not. So >there still seems to be disagreement, and I'm having difficulty reconciling >this with your statement that Smyth's formulation is a "significant >improvement." > >> You can always avoid return values by accumulating the result in >> an argument. > >Yes, that's another issue I was going to bring up. Return values are >really just a syntactic convenience. The formal properties of a language >without return values are identical to those of a language with return >values, since one can emulate return values in a number of ways. (Passing >continuations around is my pet technique.) But this is an orthogonal >issue. I'm just trying to get clarity on whether there is agreement >about what the software engineering principle called the Law of Demeter >*says*. That seems to be a prerequisite to any cogent discussion of its >effects. > >E. >