Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
research:mao:two-signatures [2011/06/17 17:50] – ebodden | research:mao:two-signatures [2011/06/17 17:51] (current) – [What could this look like in JPIs?] ebodden | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | In the [[http:// | ||
+ | Integer around(): //(1) | ||
+ | call((Integer || Number) *()): | ||
+ | Number proceed() { //(2) | ||
+ | return new Integer(proceed().intValue()); | ||
+ | } | ||
+ | | ||
+ | In this example, the advice declares an " | ||
+ | |||
+ | ===== What could this look like in JPIs? ===== | ||
+ | |||
+ | One could capture this semantics with a syntax such as: | ||
+ | |||
+ | jpi A Number()-> | ||
+ | |||
+ | Here, '' | ||
+ | |||
+ | ===== Generic Advice ===== | ||
+ | |||
+ | Another example given in the StrongAspectJ paper is the following: | ||
+ | |||
+ | < | ||
+ | <N extends Number> | ||
+ | N around(): | ||
+ | call((Integer || Float) *(..)): | ||
+ | N proceed() { | ||
+ | N n = proceed(); | ||
+ | while(n.intValue() > 100) | ||
+ | n = proceed(); | ||
+ | return n; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Here the generic type parameter '' | ||
+ | |||
+ | In JPIs one could model this as: | ||
+ | |||
+ | jpi <N extends Number> A N()-> N(); | ||
+ | |||
+ | Such a jpi could then be applied to calls such as... | ||
+ | |||
+ | Long l = System.currentTimeMillis(); | ||
+ | | ||
+ | ... while the jpi '' |