Skip to Main content Skip to Navigation
Journal articles

Effective Aspects: A Typed Monadic Embedding of Pointcuts and Advice

Ismael Figueroa 1 Nicolas Tabareau 2, 3 Éric Tanter 1
2 ASCOLA - Aspect and composition languages
Inria Rennes – Bretagne Atlantique , Département informatique - EMN, LINA - Laboratoire d'Informatique de Nantes Atlantique
Abstract : Aspect-oriented programming(AOP) aims to enhance modularity and reusability in software systems by offering an abstraction mechanism to deal with crosscutting concerns. However, in most general-purpose aspect languages aspects have almost unrestricted power, eventually conflicting with these goals. In this work we present Effective Aspects: a novel approach to embed the point- cut/advice model of AOP in a statically-typed functional programming language like Haskell. Our work extends EffectiveAdvice, by Oliveira, Schrijvers and Cook; which lacks quantification, and explores how to exploit the monadic setting in the full pointcut/advice model. Type soundness is guaranteed by exploiting the underlying type system, in particular phantom types and a new anti-unification type class. Aspects are first-class, can be deployed dynamically, and the pointcut language is extensible, therefore combining the flexibility of dynamically-typed aspect languages with the guarantees of a static type system. Monads enables us to directly reason about computational effects both in aspects and base programs using traditional monadic techniques. Using this we extend Aldrich's notion of Open Modules with effects, and also with protected pointcut interfaces to external advising. These restrictions are enforced statically using the type system. Also, we adapt the techniques of EffectiveAdvice to reason about and enforce control flow properties. Moreover, we show how to control effect interference us- ing the parametricity-based approach of EffectiveAdvice. However this approach falls short when dealing with interference between multiple aspects. We propose a different approach using monad views, a recently developed technique for han- dling the monad stack. Finally, we exploit the properties of our monadic weaver to enable the modular construction of new semantics for aspect scoping and weaving. These semantics also benefit fully from the monadic reasoning mechanisms present in the language. This work brings type-based reasoning about effects for the first time in the pointcut/advice model, in a framework that is both expressive and extensible; thus allowing development of robust aspect-oriented systems as well as being a useful research tool for experimenting with new aspect semantics.
Document type :
Journal articles
Complete list of metadata

Cited literature [44 references]  Display  Hide  Download
Contributor : Nicolas Tabareau Connect in order to contact the contributor
Submitted on : Tuesday, February 18, 2014 - 10:05:01 AM
Last modification on : Wednesday, April 27, 2022 - 4:10:58 AM
Long-term archiving on: : Sunday, May 18, 2014 - 10:36:31 AM


Files produced by the author(s)


  • HAL Id : hal-00872782, version 1


Ismael Figueroa, Nicolas Tabareau, Éric Tanter. Effective Aspects: A Typed Monadic Embedding of Pointcuts and Advice. LNCS Transactions on Aspect-Oriented Software Development, Springer, 2014. ⟨hal-00872782⟩



Record views


Files downloads