o class Point int x y public int
Sign up to view full document!
SIGN UP
従来のアスペクト指向の考え方 o アスペクトをクラス側に「挿入する」という考え class Point { int x, y; public int get. X() { return x; } public int get. Y() { return y; } public void set. X(int x) { this. x = x; } … } class Line { Point p 1, p 2; … move. By(int dx, int dy) { p 1. set. X(p 1. get. X() + dx); dy); p 2. set. Y(p 2. get. Y() ++dy); …… } } …… } } aspect public Update. Signaling { { pointcut move() : call(void Point. set. X(int)); Point. call(int)); … after() : move() { Display. update(); Display update(); } … } ■ アドバイスの実行箇所を把握しずらい □ set. Xメソッドの呼び出し箇所を把握しずらい ■ 呼び出し側のモジュール性を壊している という意見がある 3
- Slides: 9