[PRL] Contracts vs aspects

Mitchell Wand wand at ccs.neu.edu
Thu Apr 28 20:15:53 EDT 2005


Adrian Collyer writes (at
http://www.aspectprogrammer.org/blogs/adrian/2005/04/aspects_as_auto.html): 

 We'll need a requirement to work from. Let's take good old
 foobar. Everyone knows that foo comes before bar. What if we wanted
 to write an aspect to make sure that was true? More precisely, let's
 write an aspect to enforce the following rule: 

    Every call to bar() within an action must be preceded by at least
    one call to foo(). After any call to bar(), foo() must be called
    at least once before bar() can be called again.  

What would a contract for this look like?

--Mitch 



More information about the PRL mailing list