AOP/cross-cutting 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.

Slides:



Advertisements
Similar presentations
Monitoring Design Pattern Contracts Jason O. Hallstrom Clemson University SAVCBS 04 Workshop at ACM SIGSOFT 2004/FSE-12 Benjamin Tyler (Presenter) Ohio.
Advertisements

Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
INTERPRETER Main Topics What is an Interpreter. Why should we learn about them.
CS 584. A Parallel Programming Model We need abstractions to make it simple. The programming model needs to fit our parallel machine model. Abstractions.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
Chapter 8 . Sequence Control
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Deriving AO Software Architectures using the AO-ADL Tool Suite Luis Fernández, Lidia Fuentes, Mónica Pinto, Juan A. Valenzuela Universidad de Málaga
Instances and Object Diagrams Reporter: 陳雅萍. Abstractions and Instances Abstraction: the ideal essence of a thing Instance: a concrete manifestation of.
Behaviour-Preserving Model Transformation Arend Rensink, University of Twente IPA Spring Days, 18 April 2012.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Lecture 2 COM 3362, April 5, Composition example Use three aspects simultaneously with three classes. Three aspects: –ShowReadWriteAccess –InstanceLogging.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
IAY 0600 Digital Systems Design
Catalysis/Testing Catalysis Objects, components, and Frameworks with UML.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
What is “model transformation”? Distinction between source and target Source may be same as target May be multiple sources, or targets Reaching a fixed.
Expression evaluation E : S | C. S = int. C = Op E E. Op : A | M. A = “+”. M = “*”.
Validated Model Transformation Tihamér Levendovszky Budapest University of Technology and Economics Department of Automation and Applied Informatics Applied.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
Lab 04.
Slides for Gregor Kiczales Two versions –short version: Crosscutting capabilities for Java and AspectJ through DJ (4 viewgraphs only) –long version: Controlling.
Not only mark-up languages! There are other many other grammar formalisms and tools than XML. Some of them standardized (ASN). Even XML does not always.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
AOP Foundations Doug Orleans Karl Lieberherr. What we did earlier AOP languages have the following main elements: –a join point model (JPM) wrt base PL.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Towards Multi-Paradigm Software Development Valentino Vranić Department of Computer Science and Engineering Faculty of Electrical Engineering.
Adaptive Software Kevin Cella Graduate Seminar 02/04/2005.
© Siemens AG, CT SE 2 C O R P O R A T E T E C H N O L O G Y 1 Model-Driven Development for Pluggable Collaborations Iris Groher, Stephan Bleicher, Christa.
Aspect-Oriented Action Semantics Descriptions Luis Menezes University of Pernambuco
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Translating Traversals to AspectJ. Outline Motivation Demeter Process for Traversals AspectJ Translation Process.
DJ: traversal-visitor-style programming in Java Josh Marshall/ Doug Orleans Want to add more on traversal through collections and Aspectual Components.
Design-Directed Programming Martin Rinard Daniel Jackson MIT Laboratory for Computer Science.
Good for DJ over Java Extending traversals for b..* –returning a single object instead of a collection (Find) –modifying the collection (Add, Delete)
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
AOP/cross-cutting 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.
R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs.
UBC software modularity group 1/14/02 UCSD1 Discussion with Kiczales at UBC Ontology of AOP Ontology is the study of what there is, an inventory of what.
AO Mechanisms in Demeter1 Discussion with Gregor Kiczales at UBC Ontology of AOP Ontology is the study of what there is, an inventory of what exists. An.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Talk only to your friends that share the same concerns (Law of Demeter for Concerns) Midterm Review February 2004.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Features of AOP languages AOP languages have the following main elements: –a join point model (JPM) wrt base PL –a specification language for expressing.
Chapter 3 – Describing Syntax
Abstract Factory Pattern
Crosscutting Capabilities for Java and AspectJ through DJ
Good for DJ over Java Extending traversals for collections (b..*)
Graph-Based Operational Semantics
Discussion with Gregor Kiczales at UBC
Abstract Factory Pattern
Adaptive Object-Oriented Software Development
Lecture 6 Project review
ADAPTIVE PROGRAMMING Sezen ERDEM December 2005.
Subprograms and Programmer Defined Data Type
Structural style Modular design and hierarchy Part 1
CSE401 Introduction to Compiler Construction
Advanced Programming Behnam Hatami Fall 2017.
Aspect-oriented programming
APPCs revisited 2/25/2019 APPCs revisited.
Adaptive Programming in JAsCo
Presentation transcript:

AOP/cross-cutting 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

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?

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

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

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

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

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.

Generic BB A building block with holes

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.

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

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

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

Pricing Logging LoggingPricing Interface of Pricing becomes interface of LoggingPricing Summing

Counting Locking CountingLocking Interface of Counting becomes interface of CountingLocking

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(){s=0;}; void before(Target host){ s+=host.what;} } participant Target { public int what;} }

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

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

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

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

Specifying cross-cutting mapping 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.

Use of traversal strategies to specify cross-cutting in AOP Set of classes: Nodes(strategy) Graph refinement: map participant graph