On Exceptions, Events and Observer Chains

By: Mehdi Bagherzadeh, Hridesh Rajan, and Mohammad Ali Darvish Darab

PDF Download Download Paper

Abstract

Modular understanding of behaviors and flows of exceptions may help in their better use and handling. Such reasoning tasks about exceptions face unique challenges in event-based implicit invocation (II) languages that allow subjects to implicitly invoke observers, and run the observers in a chain. In this work, we illustrate these challenge in Ptolemy and propose Ptolemy-X that enables modular reasoning about behaviors and flows of exceptions for event announcement and handling. Ptolemy-X’s exception-aware specification expressions and boundary exceptions limit the set of (un)checked exceptions of subjects and observers of an event. Exceptional postconditions specify the behaviors of these exceptions. Greybox specifications specify the flows of these exceptions among the observers in the chain. Ptolemy-X’s type system and refinement rules enforce these specifications and thus enable its modular reasoning. We evaluate the utility of Ptolemy-X’s exception flow reasoning by applying it to understand a set of aspect-oriented (AO) bug patterns. We also present Ptolemy-X’s semantics including its sound static semantics.

ACM Reference

Bagherzadeh, M. et al. 2013. On Exceptions, Events and Observer Chains. Aspect-Oriented Software Development, AOSD, Fukuoka, Japan (2013), 185–196.

BibTeX Reference

@inproceedings{BagherzadehRajanDarvish2013,
  author = {Mehdi Bagherzadeh and Hridesh Rajan and Mohammad Ali Darvish Darab},
  title = {On Exceptions, Events and Observer Chains},
  booktitle = {Aspect-Oriented Software Development, AOSD, Fukuoka, Japan},
  pages = {185--196},
  year = {2013},
  publisher = {{ACM}},
  editor = {Hidehiko Masuhara and Shigeru Chiba and Naoyasu Ubayashi},
  doi = {10.1145/2451436.2451458},
  abstract = {
  Modular understanding of behaviors and flows of exceptions may help in their
  better use and handling. Such reasoning tasks about exceptions face unique
  challenges in event-based implicit invocation (II) languages that allow
  subjects to implicitly invoke observers, and run the observers in a chain. In
  this work, we illustrate these challenge in Ptolemy and propose Ptolemy-X that
  enables modular reasoning about behaviors and flows of exceptions for event
  announcement and handling. Ptolemy-X's exception-aware specification
  expressions and boundary exceptions limit the set of (un)checked exceptions of
  subjects and observers of an event. Exceptional postconditions specify the
  behaviors of these exceptions. Greybox specifications specify the flows of
  these exceptions among the observers in the chain. Ptolemy-X's type system and
  refinement rules enforce these specifications and thus enable its modular
  reasoning. We evaluate the utility of Ptolemy-X's exception flow reasoning by
  applying it to understand a set of aspect-oriented (AO) bug patterns. We also
  present Ptolemy-X's semantics including its sound static semantics.},
}