A Case for Statically Executable Advice: Checking the Law of Demeter with AspectJ

Karl Lieberherr, David H. Lorenz, Pengcheng Wu

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

We define a generic join point model for checking the Law of Demeter (LoD). Join points are trees, pointcuts are predicates over join points, and advice is checked statically similar to how declare warning is checked in AspectJ. We illustrate how the joint point form is mapped to the object and class forms of LoD, and provide an implementation in AspectJ that approximates LoD's class form by dynamically checking a particular execution using only the join points' static part. The paper proposes two ways to extend AspectJ to provide access to lexical join points directly. The first proposes statically executable advice and pointcut designators over lexical join points. The second proposes statically executable meta-advice over the exposed abstract syntax tree of the program and using Demeter style traversals to mirror AspectJ pointcuts.

Original languageEnglish
Title of host publicationProceedings of the 2nd International Conference on Aspect-Oriented Software Development, AOSD '03
Pages40-49
Number of pages10
StatePublished - 2003
Externally publishedYes
Event2nd International Conference on Aspect-Oriented Software Development - Boston, MA, United States
Duration: 17 Mar 200321 Mar 2003

Publication series

Name2nd International Conference on Aspect-Oriented Software Development

Conference

Conference2nd International Conference on Aspect-Oriented Software Development
Country/TerritoryUnited States
CityBoston, MA
Period17/03/0321/03/03

Fingerprint

Dive into the research topics of 'A Case for Statically Executable Advice: Checking the Law of Demeter with AspectJ'. Together they form a unique fingerprint.

Cite this