AOP/cross-cutting - PowerPoint PPT Presentation

About This Presentation
Title:

AOP/cross-cutting

Description:

Tease an aspect apart into three units: ideal graph, labels on nodes and edges ... An aspect is a modular unit that cross-cuts other modular units. ... – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 23
Provided by: karllie
Learn more at: https://www2.ccs.neu.edu
Category:
Tags: aop | cross | cutting | tease

less

Transcript and Presenter's Notes

Title: AOP/cross-cutting


1
AOP/cross-cutting
  • What is an aspect?

2
What is an aspect?
  • An aspect is a modular unit that cross-cuts other
    modular units.
  • What means cross-cutting?
  • Apply AOP to AOP. Tease an aspect apart into
    three units ideal graph, labels on nodes and
    edges of ideal graph, application to concrete
    graph using connectors specifies cross-cutting

3
What is an aspect?
  • An aspect is a modular unit that cross-cuts other
    modular units.
  • Example MU 1 application code, MU 2 class
    library code. Application code uses names from
    class library. Cross-cutting.
  • MU 1 is an aspect! Not reasonable
  • What is missing?

4
What is an aspect?
  • An aspect is a modular unit that cross-cuts and
    enhances other modular units.
  • Previous example now ruled out.
  • Example MU 1 APPC, MU 2 class graph.
    Cross-cutting is indirect through a connector.
    APPC is an aspect

5
Alternative definition
Stand-alone requiring context in order to
function
  • An aspect
  • is a modular unit that has no stand-alone
    function and
  • that affects other modular units

6
Other definition (Xerox PARC)
  • Implement properties. Some are implemented by
    generalized procedures. Those that are not
    implemented by generalized procedures are called
    aspects.
  • Aspects are defined modulo programming language
    and a set of components

7
Terminology
  • Building block BB
  • Participants (classes at basic level) BB of
    type 1
  • APPC BB of type 2 consisting of set of
    generic BB of type 1.
  • Connectors map generic BB implements
    cross-cutting

8
AOP
  • components building blocks type 1
  • whatever does not fit into one building block of
    type 1 is expressed as one building block type 2
    that consists of a set of generic building blocks
    of type 1.
  • generic building blocks of a building block of
    type 2 are mapped to building blocks of type 1.

9
Generic BB
  • A building block with holes

10
AOP
  • Properties of mapping
  • one generic building block is mapped to one or
    more building blocks
  • building blocks may have parts. One part of
    generic building block is mapped to one or more
    parts of corresponding generic building block.

11
Example APPCs
  • Ideal graph participant graph
  • Labels on nodes and edges participant code
  • Concrete graph participant graph or application
    class graph
  • Connectors specify cross-cutting

12
Something missing in APPCs
  • Components, connectors
  • Components
  • provided, required interface
  • required interface includes participant graph
  • participant code
  • also needs help from other components that are
    connected to local participants

13
Improved APPCs
  • Components
  • provided, required interface
  • required interface includes participant graph
  • participant code
  • list of imported components
  • connectors

14
LoggingPricing
Interface of Pricing becomes interface of
LoggingPricing
Logging
Pricing
Summing
15
CountingLocking
Interface of Counting becomes interface of
CountingLocking
Locking
Counting
16
Visitors and components?
  • component Summing
  • participant Source
  • Target t
  • int sum() cg.traverse(this, new
  • Strategy(from Source to Target),
  • new Visitor int sum s start()s0
  • void before(Target host) shost.what
  • participant Target
  • public int what

17
Example
  • Have component for Pricing
  • Want to log instance creation of three
    participant classes. Use Logging component and
    connect to three participants

18
Cross-cutting
  • Does not only mean inserting aspect code into
    enhanced unit.
  • There is interaction between aspect code and
    modified unit code. Some aspects can change
    structure of modified unit others just insert
    additional code into old structure

19
Theory of cross cutting
  • Model programs as graphs (e.g. class diagrams,
    abstract syntax trees, etc.)
  • Aspects model as graph editing instructions
    modeled with respect to an ideal graph.
  • Graph editing add new nodes and edges and add to
    node labels and edge labels

20
Specifying cross-cutting
  • Uniform node to nodes, edge to edges simple
    weaving
  • explicit A,B,C,D
  • succinct Nodes(Graph(From A to D))
  • Non-uniform edge to multiple edges code is
    different from target edge to target edge

21
Specifying cross-cuttingmapping
  • With traversal. From A to B B mapped to multiple
    targets
  • Without traversal. Two classes A and B with some
    connection? Without traversal is an uninteresting
    special case? Name map is the cross-cutting.

22
Use of traversal strategiesto specify
cross-cutting in AOP
  • Set of classes Nodes(strategy)
  • Graph refinement map participant graph
Write a Comment
User Comments (0)
About PowerShow.com