Effective aspects : A typed monadic model to control and reason about aspect interference

Ismael Figueroa 1, 2
2 ASCOLA - Aspect and composition languages
LINA - Laboratoire d'Informatique de Nantes Atlantique, Département informatique - EMN, Inria Rennes – Bretagne 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. But, in most general-purpose aspect languages aspects have almost unrestricted power, eventually conflicting with these goals. This work presents Effective Aspects: a novel approach to embed the pointcut/advice model of AOP in a statically-typed functional programming language like Haskell; along two main contributions. First, we define a monadic embedding of the full pointcut/advicemodel of AOP. Type soundness is guaranteed by exploiting the underlying type system, in particular phantom types and a new anti-unification type class. In this model 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 enable us to directly reason about computational effects both in aspects and base programs using traditional monadic techniques. Using this we extend the 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 as well as to control effect interference. We show that the parametricity-based approach to effect interference falls short in the presence of multiple aspects and propose a different approach using monad views, a novel technique for handling the monad stack, developed by Schrijvers and Oliveira. Then, we exploit the properties of our model to enable the modular construction of new semantics for aspect scoping and weaving. Our second contribution builds upon a powerful model to reason about mixin-based composition of effectful components and their interference, based on equational reasoning, parametricity, and algebraic laws about monadic effects. Our contribution is to show how to reason about interference in the presence of unrestricted quantification through pointcuts. We show that global reasoning can be compositional, which is key for the scalability of the approach in the face of large and evolving systems. We prove a general equivalence theorem that is based on a few conditions that can be established, reused, and adapted separately as the system evolves. The theorem is defined for an abstract monadic AOP model; we illustrate its use with a simple version of the model just described. This work brings type-based reasoning about effects for the first time in the pointcut/advice model, in a framework that is expressive, extensible and well-suited for development of robust aspect-oriented systems as well as a research tool for new aspect semantics.
Document type :
Theses
Complete list of metadatas

Cited literature [73 references]  Display  Hide  Download

https://tel.archives-ouvertes.fr/tel-01067730
Contributor : Abes Star <>
Submitted on : Wednesday, September 24, 2014 - 8:32:09 AM
Last modification on : Friday, June 22, 2018 - 9:31:39 AM
Long-term archiving on : Thursday, December 25, 2014 - 10:21:09 AM

File

Figueroa_I_04_2014.pdf
Version validated by the jury (STAR)

Identifiers

  • HAL Id : tel-01067730, version 1

Citation

Ismael Figueroa. Effective aspects : A typed monadic model to control and reason about aspect interference. Software Engineering [cs.SE]. Ecole des Mines de Nantes, 2014. English. ⟨NNT : 2014EMNA0220⟩. ⟨tel-01067730⟩

Share

Metrics

Record views

618

Files downloads

657