From Brad_Appleton-GBDA001@aieg.mot.com Sun Oct 27 23:02:45 1996 From: Brad Appleton Subject: Re: (OTUG) Law of Demeter (fwd) To: lieber@ccs.neu.edu Date: Sun, 27 Oct 1996 22:03:37 -0600 (CST) Reply-To: Brad_Appleton-GBDA001@email.mot.com Organization: Motorola Automotive and Industrial Electronics Group I sent the following reply to the OTUG-mailing list regarding Jeff Sutherland's posting of an answer from the O-O FAQ that seems to be three years old. -- Brad_Appleton@email.mot.com Motorola AIEG, Northbrook, IL USA "And miles to go before I sleep." DISCLAIMER: I said it, not my employer! Appleton writes: > From appleton Sun Oct 27 21:22:36 1996 > Subject: Re: (OTUG) Law of Demeter > To: otug@rational.com (Object Technology user's group) > Date: Sun, 27 Oct 1996 21:22:36 -0600 (CST) > Reply-To: Brad_Appleton-GBDA001@email.mot.com > In-Reply-To: <01IB4SCOHWMU8WVZI0@delphi.com> from "jsutherland@bix.com%INTERNET" at Oct 27, 96 06:25:44 am > Organization: Motorola Automotive and Industrial Electronics Group > > jsutherland@bix.com%INTERNET writes: > > Check out Karl Lieberherr's stuff. He has a company by the name ... > > Im not sure about the company (I belive a Demeter International exists > but I dont know if Lieberherr is the one that has/owns it) but Dr. > Lieberherr *does* have a "method" and project named Demeter at > Northeastern University. > > > The Law of Demeter idea has been automated in the Demeter Tools/C++ > > This excerpt from the FAQ needs to be updated (it is over three years > old after all). The URL http://www.ccs.neu.edu/research/demeter/ is > where the Demeter/Adaptive Programming home page lives and is probably > the most up-to-date source of info on Demeter. From that page you can > find out about Dr. Lieberherr's book and university course on Demeter > (as well as *many* papers on the subject) and the Demeter tools for > Java, C++, Tcl/Tk and Perl5. There are also some adaptive programming > patterns at this URL. > > MUCH has happened with Demeter and its tools since 1993. There are > versions of the Demeter tools that work with Tcl/Tk, Perl5, and (most > recently) *Java*. In fact, the Demeter Tools fit better with Java than > C++. Also, Demeter has added "visitor" type traversal objects (what > Lieberherr calls an "Adaptive Visitor") which are a more seamless fit with > OOPLs than a relational-ish graph-navigation-specification language. > Before the adaptive visitor objects were used, Adaptive C++/Demeter > programs looked kind of like SQL-style from-to statements and contraints > with embedded C++ code (or vice versa). Now (with Java and adaptive > visitors) they look more like a single language rather than two mixed > together > > > The Demeter Tools/C++ lift object-oriented programming to a higher level > > of abstraction by allowing the user to focus on the essential and stable > > classes. > > The above is true of Demeter in general (not just the Demeter/C++ tools). > It uses a "class graph" of a system to indicate all the inheritance and > containment relationships between objects in the system. The graph can > be represented textually as a grammar. If the "grammar" is LL(1) (or can > be reduced to an LL(1) grammar -- which is usually the case) then there > are lots of nice properties it has that lets the Demeter tools determine > and automate all sorts of nice things for you. > > Hence, the basic gist of it is that if you need to code a method that > has to navigate (via other methods and/or objects) across several > links and intermediate links to process information, then using the > Demeter tools, you (the "adaptive programmer") rarely have to concern > yourself with knowledge of any objects along the navigation path other > than the source and destination classes/vertices and perhaps some (but > not all) key intermediate objects/vertices. The Demeter tools can > generate all the intermediate navigations from the class graph and your > from-to spec (with optional contraints). Later, when your class graph > evolves and changes, the code for the method you wrote doesn't need to be > modified at all (since you specified it "adaptively" as a propagation > pattern using succinct traversal specifications). All you usually need > to do is just regenerate the traversal code with Demeter and then > recompile. > -- > Brad_Appleton@email.mot.com Motorola AIEG, Northbrook, IL USA > "And miles to go before I sleep." DISCLAIMER: I said it, not my employer!