Example: Write accesses
class Point {
int _x = 0;
int _y = 0;
void set(int x, int y) {
_x = x; _y = y;
}
void setX(int x)
{ _x = x; }
void setY(int y)
{ _y = y; }
int getX(){
return _x; }
int getY(){
return _y; }
}
aspect ShowAccesses {
static before Point.set,
Point.setX,
Point.setY {
System.out.println(“W”);
}
}
View v1 = aspect
View v2 = component
Previous slide
Next slide
Back to first slide
View graphic version