150 likes | 271 Views
Fluid AOP Join Point Models. Terry Hon Gregor Kiczales. Fluid AOP. Modularization of crosscutting concerns in IDE Aspect is alternative view modularizes crosscutting concern can be generated each time it is needed or can be stored as a metaobject. Fluid vs. Linguistic AOP.
E N D
Fluid AOP Join Point Models Terry Hon Gregor Kiczales
Fluid AOP • Modularization of crosscutting concerns in IDE • Aspect is alternative view • modularizes crosscutting concern • can be generated each time it is needed • or can be stored as a metaobject Fluid AOP - Terry Hon & Gregor Kiczales
Fluid vs. Linguistic AOP • Linguistic AOP • Aspects are programming language constructs • Defined semantics: only execution is woven • Fluid AOP • Aspects are IDE constructs • It may look like programming language constructs • Defined semantics: IDE view is explicitly woven Fluid AOP - Terry Hon & Gregor Kiczales
Experiments in Fluid AOP JPMs • 2 Fluid AOP Join Point Models • What are join points? • How are they identified? • How is crosscutting combined? • Using Eclipse • Edit time weaving Fluid AOP - Terry Hon & Gregor Kiczales
1st JPM – Block Linking • Join points • Code fragments in java files • Method • Constructor • Field • Means of identifying join points • Pointcuts: method, field or constructor signatures, type patterns • Means of combining crosscutting • Identical blocks • All linked, any block can be edited Fluid AOP - Terry Hon & Gregor Kiczales
Display Updating Aspect • Canonical AspectJ example publicaspect DisplayUpdating pointcut change: execution(public void Shape+.set*(*)) after returning: change { } • Note has no advice/pointcut parameters Fluid AOP - Terry Hon & Gregor Kiczales
Intertype Declarations • Want to add a Display field for each Shape class • Instead of calling static update method, we will call update on the Display object public aspect DisplayUpdating pointcut change: execution(public void Shape+.set*(*)) after returning: change { display.update(); } declare for Shape: { protected Display display; } Fluid AOP - Terry Hon & Gregor Kiczales
1st JPM – Block Linking • Join points • Code fragments in java files • Method • Constructor • Field • Means of identifying join points • Pointcuts: method, field or constructor signatures, type patterns • Means of combining crosscutting • Identical blocks • All linked, any block can be edited Fluid AOP - Terry Hon & Gregor Kiczales
2ndJPM – Overlay • Join points • Code fragments in java files • Method • Constructor • Means of identifying join points • Pointcuts: method or constructor signatures, type patterns • Means of combining crosscutting • Join points are all different • Editable merge Fluid AOP - Terry Hon & Gregor Kiczales
Variable references (with different names) in join points Identical parts in join points Fluid AOP - Terry Hon & Gregor Kiczales
Block Linking vs. Overlay Crosscutting effects are identical No context of JPs in aspect Edit in linked advice block Can recreate aspect by code inspection without Fluid AOP tool Crosscutting effects can be different Some context of JPs in aspect Edit in linked merged structure Cannot recreate aspect unless we know list of JPs Fluid AOP - Terry Hon & Gregor Kiczales
Current Questions Block Linking JPM • What happens when a developer changes an advice body outside of the aspect file? • What happens if an advice body is deleted? Overlay JPM • What are rules for merging and overlaying? • How should overlay look? Fluid AOP - Terry Hon & Gregor Kiczales
Open Issues • What are other JPMs in Fluid AOP? • What is the best way to show a ccc (modularizing both viewing and editing of JPs)? • Possible intermediate step in AOP adoption or AOP solution qua itself? • Java tools can be used on all but aspect files • Aspect files are only meta files • Edit time weaving Fluid AOP - Terry Hon & Gregor Kiczales
Related Work • Linked editing • Toonim et. al.: CodeLink • Miller et. al.: Simultaneous Editing • Editable virtual views • Chu-Carroll et. al.: VSC • Janzen et. al: Decal • Quitslund: MView • Linguistic • Harrison et. al.: CME • Quitslund et. al.: Java Traits Fluid AOP - Terry Hon & Gregor Kiczales
Questions? Fluid AOP Join Point Models Terry Hontyehon@cs.ubc.ca