basis of crosscutting

6
1/14/02 UCSD 1 UBC software modularity group basis of crosscutting a join point model (JPM) has 3 critical elements what are the join points • in AspectJ – points in runtime call graph – class members means of identifying join points • in AspectJ – signatures (plus …) means of specifying semantics at join points • in AspectJ – advice – define members

description

basis of crosscutting. a join point model (JPM) has 3 critical elements what are the join points in AspectJ points in runtime call graph class members means of identifying join points in AspectJ signatures (plus …) means of specifying semantics at join points in AspectJ advice - PowerPoint PPT Presentation

Transcript of basis of crosscutting

Page 1: basis of crosscutting

1/14/02 UCSD 1 UBC software modularity group

basis of crosscutting

• a join point model (JPM) has 3 critical elements– what are the join points

• in AspectJ– points in runtime call graph– class members

– means of identifying join points• in AspectJ

– signatures (plus …)– means of specifying semantics at join points

• in AspectJ– advice– define members

Page 2: basis of crosscutting

1/14/02 UCSD 2 UBC software modularity group

basis of crosscutting

• a join point model (JPM) has 3 critical elements– what are the join points

• in AspectJ– points in runtime call graph– class members

– means of identifying join points• in AspectJ

– pointcuts– member signatures (plus …)

– means of specifying semantics at join points• in AspectJ

– advice– define members

dynamic JPMstatic JPM

Page 3: basis of crosscutting

1/14/02 UCSD 3 UBC software modularity group

range of AOP languages

means of … join points

JPM join points identifying specifying semantics at

AspectJ dynamic JPM

points in execution call, get, set…

signaturesw/ wildcards & other properties of JPs

advice

static JPM class members signatures add members

Composition Filters message sends & receptions

signature & property based object queries

wrappers declarative (filters) imperative (advice)

Hyper/J members signatures add, compose (and remove) members

Demeter traversals when traversal reaches object or edge

class & edge names

define visit method

See next slide for changes to

AspectJ and Demeter

Page 4: basis of crosscutting

1/14/02 UCSD 4 UBC software modularity group

range of AOP languages

means of … join points

JPM join points identifying specifying semantics at

AspectJ dynamic JPM

points in execution call, get, set…

signaturesw/ wildcards & other properties of JPs

advice

static JPM classes class names add members

Demeter

static JPM 1

static JPM 2

when traversal reaches object or edge

classes

classes

visitor method signatures

traversal spec. sclass graph g

class names

visitor method bodies

add traversal membersbased on s,g

add members

Page 5: basis of crosscutting

1/14/02 UCSD 5 UBC software modularity group

Composing join point models

• Traversal Spec JPM: In Demeter we use traversal specifications and the class graph to introduce traversal methods to a set of classes.

• Visitor JPM: The result of Traversal Spec. JPM is used to define a second JPM: – The traversal methods define nodes and edge visits. – Visitor signatures define the nodes and edges where

additional advice is needed: they are the means of identifying join points.

– The means of specifying semantics at join points are the visitor bodies.

Page 6: basis of crosscutting

1/14/02 UCSD 6 UBC software modularity group

• foo– dynamic JPM (~ AspectJ)– what happens in pattern

• bar

AO design in UML

• Composition Patterns– static JPM (~ Hyper/J)– binds pattern to base code

• UML class & interaction diagrams already crosscut– by-class vs. by-interaction organizations

[Clarke, Walker]