RE: [Demetercop-info] discovering traversals

Subject: RE: [Demetercop-info] discovering traversals
From: Karl Lieberherr (
Date: Tue Sep 24 2002 - 15:40:56 EDT

Hi Jeff:

the enclosed paper contains some ideas on this topic of discovering
Silva-Lepe's thesis contains more. I think there are many improvements
possible here. It is clear that following the Law of Demeter leads to
a lot of scattering which we would like to eliminate by using traversal
and visitors.

I think it is not easy to refactor code that it is not written in a
style into this style. Your thoughts below sound promissing.

You can always automatically construct a traversal strategy using the
following approach:
Input: class graph G and a subgraph TG of G which denotes the traversal.
Source s and target t.
Output: from s bypassing { ... } to t

Color edges reachable from s red.
Color edges from which t is reachable blue.
If red intersect blue is too big, add an edge to { ... } and repeat.

But those negative strategies with bypassing are not very robust.

-- Karl

> -----Original Message-----
> From:
> []On Behalf Of Jeffrey
> Palm
> Sent: Tuesday, September 24, 2002 1:12 PM
> To: demetercop-info
> Subject: [Demetercop-info] discovering traversals
> Karl and Ken
> I had another idea, which was extending the eclipse tool to discover
> traversals of objects through the program, and, possibly, offer a
> solution in DJ.
> The idea would be to construct a graph whose vertices would be method
> declarations and whose edges would be method calls. Then for each
> object created track whether it is being sent through a traversal.
> After that suggest DJ solutions for creating traversal strategies...
> Any thoughts on this??? Thanks.
> Jeff
> --
> Jeffrey Palm -->
> -------------------------------------------------------
> This email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> _______________________________________________
> Demetercop-info mailing list

This archive was generated by hypermail 2b28 : Tue Sep 24 2002 - 15:38:28 EDT