demo: object-oriented IDE
good at showing hierarchical OO structure…
demo: modularize concern
· Show FigureEd running · Inspect Point.java · Use joinpoint probe to find | call(void figures.Canvas.updateHistory()) && within(*)
· Describe places that it’s called · create aspect (defines a special class that can crosscut other classes) · aspect HistoryUpdating · write pointcut (has name and parameters) | pointcut moves(): call(void Line.setP1(Point)) || call(void Line.setP2(Point));
· write after advice (runs “on the way back out”) | after() returning: move() { <runs after each move> }
· extend advice to Point setters (multi-class) | call(void FigureElement+.set*(..))
· capture context & use interface | move(FigureElement fe): target(fe) &&..
· Show structure, note that SlothfulPoint is now included · Run & show effect |
· Show Point.moveBy history violoation · Want to make sure that sets of private fields of classes implementing FigureElement only happen from within the set methods | declare warning: set(private * FigureElement+.*) && !(withincode(* FigureElement+.set*(..)) || withincode(FigureElement+.new(..))): "should only assign to fields from set methods";
· Write before advice that does precondition checking on Points. | before(int newValue): set(int Point.*) && args(newValue) { if (newValue < 0) { throw new IAE("too small"); } }
demo: pluggable aspects
· World’s first fully interactive video game, now 41 years old.. · Explain spacewar · Launch with Ship.java and "Release.lst" selected and compiled. | Run Show debug configuration in config designer Select "Debug.lst", compile, and run again Show debug window, menu, and method tracing
demo: crosscutting structure
• Explain annotations over program structure • Explain links and associations, inheritance links • Explain model genericity, different views • Show inline annotations • Show history navigation | • Show global views (multiple views of your code) • Show refactoring by changing helmCommandsCut • Show view synchronization, task-oriented views • Discuss how it is harder in AJ (implicit invocation) • Show fluid documents (ISTL project)