Event Type Polymorphism

By: Rex Fernando, Robert Dyer, and Hridesh Rajan

PDF Download Download Paper
Slides

Abstract

Subtype polymorphism is an important feature available in most modern type systems which makes code reuse and specialization possible. Recent works on separation of crosscutting concerns have created event interfaces (types) to decouple subjects from handlers. Extending the notion of subtyping to these event interfaces is a logical step. In this paper, we define event type polymorphism in the context of the Ptolemy language. Ptolemy allows declaring quantified, typed events which provide an interface between subjects and handlers. We add the notion of polymorphic event types to the Ptolemy language, defining a subtype relation among event types which in turn allows for both depth and width subtyping with regard to event context. Since Ptolemy only has explicit event announcement, our semantics is simpler and easier to reason about when compared to previously defined approaches. We also give the first formally defined static semantics for polymorphic events as well as demonstrate its usefulness via examples.

ACM Reference

Fernando, R. et al. 2012. Event Type Polymorhphism. FOAL ’12: Workshop on Foundations of Aspect-Oriented Languages workshop (Mar. 2012).

BibTeX Reference

@inproceedings{fernando2012event,
  author = {Rex Fernando and Robert Dyer and Hridesh Rajan},
  title = {Event Type Polymorhphism},
  booktitle = {FOAL '12: Workshop on Foundations of Aspect-Oriented Languages workshop},
  location = {Potsdam, Germany},
  month = {March},
  year = {2012},
  entrysubtype = {workshop},
  abstract = {
    Subtype polymorphism is an important feature available in most modern type
    systems which makes code reuse and specialization possible. Recent works on
    separation of crosscutting concerns have created event interfaces (types) to
    decouple subjects from handlers. Extending the notion of subtyping to these
    event interfaces is a logical step. In this paper, we define event type
    polymorphism in the context of the Ptolemy language. Ptolemy allows declaring
    quantified, typed events which provide an interface between subjects and
    handlers. We add the notion of polymorphic event types to the Ptolemy
    language, defining a subtype relation among event types which in turn allows
    for both depth and width subtyping with regard to event context. Since Ptolemy
    only has explicit event announcement, our semantics is simpler and easier to
    reason about when compared to previously defined approaches. We also give the
    first formally defined static semantics for polymorphic events as well as
    demonstrate its usefulness via examples.
  }
}