1 Why do we need XAspects Structure-shyness –Can build DSL objects using constructors and use AspectJ to implement meaning of DSL objects. Is inconvenient.

Slides:



Advertisements
Similar presentations
AspectWerkz 2 - and the road to AspectJ 5 Jonas Bonér Senior Software Engineer BEA Systems.
Advertisements

Mohamed ElBendary and John Boyland University of Wisconsin-Milwaukee.
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Aspect Oriented Programming. AOP Contents 1 Overview 2 Terminology 3 The Problem 4 The Solution 4 Join point models 5 Implementation 6 Terminology Review.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
1 Shyness in Programming Karl Lieberherr Demeter Research Group Northeastern University Boston.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Modularization.
1 Shyness in Programming Karl Lieberherr Demeter Research Group Northeastern University Boston.
Overview of AspectJ Aspect Oriented Software Development Seminar Technion presented by Oren Mishali.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
ASPECT ORIENTED SOFTWARE DEVELOPMENT Prepared By: Ebru Doğan.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
UML class diagrams and XML schemas Karl Lieberherr UBS AG Northeastern University.
A Formal Model of Modularity in Aspect-Oriented Programming Jonathan Aldrich : Objects and Aspects Carnegie Mellon University.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
3/7/2003Bioinformatics1 How To Address Rapidly Changing Data Representations in an Evolving Scientific Domain Using Aspect-oriented Programming Techniques.
“Enhancing Reuse with Information Hiding” ITT Proceedings of the Workshop on Reusability in Programming, 1983 Reprinted in Software Reusability, Volume.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Extensible Plug-ins for Aspect-Oriented Programming Macneil Shonle*Ankit Shah.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Aspect Oriented Programming Gülşah KARADUMAN.
3/7/2003 ABB rapid change 1 How To Address Rapidly Changing Data Representations in an Evolving Scientific Domain Using Aspect-oriented Programming Techniques.
Slides for Gregor Kiczales Two versions –short version: Crosscutting capabilities for Java and AspectJ through DJ (4 viewgraphs only) –long version: Controlling.
1 The Modular Structure of Complex Systems Presented by: SeyedMasoud Sadjadi and Wei Zhu David L. Parnas, Paul C. Clement, and David M. Weiss ICSE 1984.
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
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.
Aspect-Oriented Programming An Introductory Presentation Mike Landi MSCS Candidate Union University.
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.
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
Adaptive Software Kevin Cella Graduate Seminar 02/04/2005.
1 XAspects An Extensible System for Domain- Specific Aspect Languages Macneil Shonle (UCSD) Karl Lieberherr (Northeastern University) Ankit Shah (Northeastern.
Course Progress Lecture 1 –Java data binding: Basket example: UML class diagram -> class dictionary without tokens-> language design -> class dictionary.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Checking LoD in AspectJ Show the idea, not the details. How can we precisely express it in a programming language?
Demeter Interfaces: AP without Surprises Prof. Karl Lieberherr and Therapon Skotiniotis, Jeffrey Palm.
The Interpreter Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Adaptive Aspect-Oriented Programming in AspectJ Karl J. Lieberherr Northeastern University.
Advanced Software Development Karl Lieberherr CSG 260 Fall Semester
Aspect Security - RaviShekhar Gopalan - Prof. Lieberherr Software Security (CSG379)
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern University.
3 Project Objectives Aspectual Collaborations (AC) for the Connection Aspect –Metric: Does the restructuring of the UAV code with AC reduce the tangling.
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.
COM1205 TraversalJ Project* Pengcheng Wu Feb.25,2003.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
1 An AOP Implementation Framework for Extending Join Point Models Naoyasu Ubayashi(Kyushu Institute of Technology, Japan) Hidehiko Masuhara(University.
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.
Talk only to your friends that share the same concerns (Law of Demeter for Concerns) Midterm Review February 2004.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Pattern Language for AP1 Pattern Language for Adaptive Programming (AP) Karl Lieberherr Northeastern 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.
UCI Feb 031 Adaptive Aspect-Oriented Programming in AspectJ Karl J. Lieberherr Northeastern University Joint work of Demeter Research Group.
Software Engineering Lecture 7
Discussion with Gregor Kiczales at UBC
Demeter Aspects Who We Are Aspectual Collaborations
Aspect-Oriented Programming
ADAPTIVE PROGRAMMING Sezen ERDEM December 2005.
Better Separation of Crosscutting Concerns with Aspectual Components
LoD in AspectJ Karl Lieberherr.
AOSD and the Law of Demeter: Shyness in Programming
AspectAda Aspect-Oriented Programming for Ada95
Aspect Oriented Software Design
Presentation transcript:

1 Why do we need XAspects Structure-shyness –Can build DSL objects using constructors and use AspectJ to implement meaning of DSL objects. Is inconvenient (sentence is shorter than abstract syntax tree = object) and Lack of static checking in AspectJ –Hinders static checking of DSL objects Improved AspectJ => makes implementation of plugins easier

2 Another weakness of general aspect-oriented programming is the difficulty of using the language correctly. A novice can easily create an infinite loop in AspectJ if an advice happens to apply to itself. More subtle misapplications of advice can also occur that are not so easily observed. If a custom aspect language is created for a specific domain these misapplications can be checked by the plug- in. While a reusable AspectJ aspect might be able to implement some of the functionalities of an XAspects plug-in, it cannot perform some of the compile time checks needed to ensure that the aspect is being used correctly. Lieberherr [11] discusses extensions that could be made to AspectJ’s static property checker to make it more useful.

3 Currently, the envisioned statically executable advice only works on the lexical join point model of AspectJ. But it can also be generalized to a extensible lexical join point model. For example, we may view 'declare‘ syntax also part of the lexical join point model so that one can write his/her own 'statically exeuctable advice' on this lexical tree to do some domain specific compile-time checking, instead of letting each plug-in do the checking. --Pengcheng

4 Goal of AOSD Decompose problem into –Representation languages that support structure-shy representations of objects (Object representation concern for input/output/intermediate objects) Benefit: define objects in a structure-shy way. Need structure- shy language design (not XML). –domain-specific aspect languages that support concern- shy representations of concerns. Aspect languages are representation-languages-shy.

5 Shyness can be defined in many different ways: An implementation of a concern C_1 is C_2-shy if: The C_1 implementation relies only on minimal information of C_2 implementations. The C_1 implementation can adapt to small changes in C_2 implementations. Topological. A small change in a C_2 implementation leads to a smaller change in the C_1 implementation. The C_1 implementation is loosely coupled with C_2 implementations. The C_1 implementation can work with a family C'_2, C''_2, C'''_2, … of C_2 implementations that are “similar”.

6 Shy: a useful term AP = concern-shy programming –D*J: class-graph-shy programming AOP = module-shy programming –AspectJ is call-graph-shy programming –AspectJ is class-graph-shy programming –AspectJ-DAJ is better class-graph-shy programming Obliviousness: program is aspect-shy D*J = DemeterJ/DJ/DAJ

7 Component/aspect languages? Other relevant, but different, tools for domain-specific component languages are ExCIS~\cite{sdp- vanderbilt-white-batory}, JTS~\cite{batory98jts}, and DiSTiL~\cite{smaragdakisdisti l}.

8 Useful distinction? In this paper, we will refer to these non- crosscutting languages as domain- specific component languages. One example of a domain-specific component language is a parser generator tool. Parser is a weaving tool: sentence and grammar are woven into an object.

9 ? Class dictionaries do not encapsulate crosscutting concerns because class dictionaries only generate new classes; they do not modify existing classes. For this reason the class dictionary language is a domain-specific component language.

10 Mitch Suggestion Spectrum –Oblivious Nothing at all –Information-Hiding Stay outside. Well defined interface –Shyness Goes inside; information restriction Program, structure, class graph, call graph, concern, aspect

11 Information hiding (black box) XI Shyness (white box) XI Simple compilationComplex weaving Y Y X robust wrt Y X Y-shy => X robust wrt Y

12 What is I? A type –Modules: specified by a signature –Translucency: a class graph, constrained by a set of traversal strategies and a set of ordering constraints. See paper by Palsberg on class graph inference from adaptive program

13 Translucent: a useful term AP = concern-translucent programming –D*J: class-graph-shy programming AOP = module-translucent programming –AspectJ is call-graph-translucent programming –AspectJ is class-graph-translucent programming –AspectJ-DAJ is better class-graph-translucent programming The base program is opaque wrt the aspect The base program is oblivious wrt the aspect D*J = DemeterJ/DJ/DAJ

14 Defs. Transparent: Capable of transmitting light so that objects or images can be seen as if there were no intervening material. Not shy at all. Translucent: Transmitting light but causing sufficient diffusion to prevent perception of distinct images. Shy. Opaque: Impenetrable by light; neither transparent nor translucent. Information hiding. Black box = completely shy.

15 An oo program is opaque wrt a library implementation The base program is opaque wrt the aspect An oo program is transparent wrt class graph An adaptive program should be translucent wrt class graph A sentence should be translucent wrt grammar structure

16 Implementation hiding (black box) opaque XI adaptiveness (white box) translucent XI Simple compilationComplex weaving Y Y X robust wrt Y X Y-translucent => X robust wrt Y

17 Tranlucency Kinds Concern-translucent –Graph-translucent CallGraph-translucent ClassGraph-translucent –AP-WildCard –AP-Strategy

18 Testing translucent Concern-translucent: concern translucent wrt other concerns –Structure-translucent: concerns translucent wrt graph structure WildCard: aspects translucent through wildcards –AspectJ: *,.., this, target, args, call, execution, … (call graph) Strategy: three level model using strategies –AP-Call: aspects translucent wrt call graph using strategies »AspectJ: cflow

19 Shyness Only works in the presence of a succinctness property: must be able to derive a big structure from a small one in the presence of a context structure. Small structure and context structure crosscut each other.

20 Switch Topics Crosscutting graphs: strategy graphs and class graphs Improving the design of DJ and DAJ using intersection –Need only one class graph

21 Crosscutting graphs declare strategy: everyBook: "intersect(from University to Book, skipDorms)"; declare strategy: skipDorms: "from * bypassing Dorm to *";

22 How implemented intersect(s 1,s 2,s 3, …, s n ) Size(s i )=c c n : too big Instead?

23 How implemented intersect(s 1,s 2,s 3, …, s n ) Size(s i )=c c n : too big Instead? Create traversal graphs tg i (cg,s i ) Interpret all n traversal graphs in parallel during object traversal

24 How general? The thread synchronization aspect language was taken from the COOL programming language: 19 aspect(Coordination) MusicRegistryThreading 20 changes(MusicRegistry) { 21 declare selfex: register; 22 declare mutex: {register, getCD}; 23 } aspect(Sink) MyAspect extends A implements A, B personifies(Z, L), changes(D)

25 Shyness in Programming Karl Lieberherr Demeter Research Group Northeastern University Boston