examples:example5

Identifying New Kinds of Events

In Facebook, a user can interact with applications, events, messages, and many other elements. When a user interacts with one of these elements, a description is added to the user wall (i.e. a single page overview of recent user activity). Wall reporting is clearly a crosscutting concern; it can be modularized using an aspect.

However, specifying the appropriate pointcut is not straightforward. The standard approach is to define it as the union of all calls (or executions) of the functions “corresponding to” interactions of the user with Facebook elements. Nevertheless, this does not always work. For instance, when the user adds an already-added application, the change is discarded. Defining a pointcut that matches when an application is effectively added is not straightforward. For these kinds of cases, AspectScript provides custom join points as in Ptolemy, whose underlying idea is to trade obliviousness for precision and abstraction.

The implementation follows:

Toggle between the code and example

  • examples/example5.txt
  • Last modified: 2009/11/06 16:43
  • by aspectscript