>From dougo@ccs.neu.edu Mon Sep 1 17:25:05 1997 >Received: from vega.neu.edu (vega.ccs.neu.edu [129.10.115.77]) > by amber.ccs.neu.edu (8.8.6/8.7.3) with SMTP id RAA01667; Mon, 1 Sep 1997 17:25:03 -0400 (EDT) >Received: by vega.neu.edu (SMI-8.6/SMI-SVR4) > id RAA26004; Mon, 1 Sep 1997 17:24:50 -0400 >Date: Mon, 1 Sep 1997 17:24:50 -0400 >Message-Id: <199709012124.RAA26004@vega.neu.edu> >From: Doug Orleans >To: Karl Lieberherr >Cc: boaz@ccs.neu.edu >Subject: Re: example in Demeter/Java >In-Reply-To: <199708302327.TAA14121@stockberg.ccs.neu.edu> >References: <199708302327.TAA14121@stockberg.ccs.neu.edu> >X-Mailer: VM 6.22 under 19.15 XEmacs Lucid >X-Face: (4D-osoq?}7M3\EgvbWKo tsxTzT"g.oP0dTl!q >Mime-Version: 1.0 (generated by tm-edit 7.106) >Content-Type: text/plain; charset=US-ASCII >Status: R > >Karl Lieberherr writes: > > Next we define a traversal/visitor combination {\tt t}, > > called traversal {\tt t}, > >I call this a "traversal method", which is a strategy combined with a >list of parameter types (visitor classes). > > > We may specialize traversal {\tt t} by > > creating methods using subclasses of {\tt CountingVisitor}. > >This statement doesn't make much sense, and seems extraneous to the >discussion anyway. > > > Finally, we define a method {\tt CountCertainEs} for class {\tt A} > > which defines > > with which subclass of {\tt CountingVisitor} we want to do the work. > >I call this an "adaptive method". > > > To summarize the adaptive programming approach used above, called > > the strategy/visitor style, we note > > that behavior is expressed in terms of strategies and > > visitors. Strategies and visitors are combined in two steps: > > 1. First a family of strategy/visitor combinations, > > called traversals (overloading the term), > > is defined. 2. A specific member of this family is selected by specifying > > which specific visitor subclass to use. > >This notion of a "family" is kind of confusing-- a traversal method is >exactly that, a method that defines a traversal (using a strategy). >Also, as long as you use "traversal strategy" everywhere to mean an >abstract path directive (i.e. not attached to a particular class >structure or visitor class), and "traversal method" to mean a method >attached to a class that traverses an object graph, I don't think >there's any overloading. However, it's still a little confusing to >bring this up-- again, maybe using the "inline" style of adaptive >methods directly would be clearer for the discussion? The paper is >about strategies, not the ability to re-use visitors (as opposed to >your keynote speech, which is about both). E.g. simply: > > \begin{verbatim} > A{ > int CountCertainEs() do S { > before E (@ return_val++; @) > } > } > \end{verbatim} > >Hm, now that I look at it, I wonder if "use" would be a better keyword >than "do" for referring to named strategies? Or "using"? Hm. > >--Doug >