TY - JOUR
T1 - Traversals of object structures
T2 - Specification and efficient implementation
AU - Lieberherr, Karl
AU - Patt-Shamir, Boaz
AU - Orleans, Doug
PY - 2004/3
Y1 - 2004/3
N2 - Separation of concerns and loose coupling of concerns are important issues in software engineering. In this paper we show how to separate traversal-related concerns from other concerns, how to loosely couple traversal-related concerns to the structural concern, and how to efficiently implement traversal-related concerns. The stress is on the detailed description of our algorithms and the traversal specifications they operate on. Traversal of object structures is a ubiquitous routine in most types of information processing. Ad hoc implementations of traversals lead to scattered and tangled code and in this paper we present a new approach, called traversal strategies, to succinctly modularize traversals. In our approach traversals are defined using a high-level directed graph description, which is compiled into a dynamic road map to assist run-time traversals. The complexity of the compilation algorithm is polynomial in the size of the traversal strategy graph and the class of graph of the given application. Prototypes of the system have been developed and are being successfully used to implement traversals for Java and Aspect J [Kiczales et al. 2001] and for generating adapters for software components. Our previous approach, called traversal specifications [Lieberherr 1992; Palsberg et al. 1995], was less general and less succinct, and its compilation algorithm was of exponential complexity in some cases. In an additional result we show that this bad behavior is inherent to the static traversal code generated by previous implementations, where traversals are carried out by invoking methods without parameters.
AB - Separation of concerns and loose coupling of concerns are important issues in software engineering. In this paper we show how to separate traversal-related concerns from other concerns, how to loosely couple traversal-related concerns to the structural concern, and how to efficiently implement traversal-related concerns. The stress is on the detailed description of our algorithms and the traversal specifications they operate on. Traversal of object structures is a ubiquitous routine in most types of information processing. Ad hoc implementations of traversals lead to scattered and tangled code and in this paper we present a new approach, called traversal strategies, to succinctly modularize traversals. In our approach traversals are defined using a high-level directed graph description, which is compiled into a dynamic road map to assist run-time traversals. The complexity of the compilation algorithm is polynomial in the size of the traversal strategy graph and the class of graph of the given application. Prototypes of the system have been developed and are being successfully used to implement traversals for Java and Aspect J [Kiczales et al. 2001] and for generating adapters for software components. Our previous approach, called traversal specifications [Lieberherr 1992; Palsberg et al. 1995], was less general and less succinct, and its compilation algorithm was of exponential complexity in some cases. In an additional result we show that this bad behavior is inherent to the static traversal code generated by previous implementations, where traversals are carried out by invoking methods without parameters.
KW - Adaptive programming
KW - Aspect-oriented programming
KW - Class graphs
KW - Low of demeter
KW - Object graphs
KW - Strategy graphs
KW - Structure-shy software
UR - http://www.scopus.com/inward/record.url?scp=1842685662&partnerID=8YFLogxK
U2 - 10.1145/973097.973102
DO - 10.1145/973097.973102
M3 - ???researchoutput.researchoutputtypes.contributiontojournal.article???
AN - SCOPUS:1842685662
SN - 0164-0925
VL - 26
SP - 370
EP - 412
JO - ACM Transactions on Programming Languages and Systems
JF - ACM Transactions on Programming Languages and Systems
IS - 2
ER -