An Overview of Aspects Shmuel Katz Computer Science Department The Technion

Slides:



Advertisements
Similar presentations
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
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.
An Aspect-Oriented Approach For Web Application Access Control Presented by: Mohamed Hassan Carleton University Carleton University
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
University of British Columbia Software Practices Lab Fluid AOP Join Point Models Terry Hon Gregor Kiczales.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
359D 16/1/07 Eric Wohlstadter What is Middleware? What is Aspect-Oriented Programming? Introductions Course Format –Discussions –Assignments.
Review Amit Shabtay. March 3rd, 2004 Object Oriented Design Course 2 Review What have we done during the course? Where to learn more? What is for the.
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.
Categories of Aspects Shmuel Katz Computer Science Department The Technion Haifa, Israel.
Rigorous Fault Tolerance Using Aspects and Formal Methods Shmuel Katz Computer Science Department The Technion Haifa, Israel
Aspect Oriented Programming Written by Michael Beder.
More on AspectJ. aspect MoveTracking { private static boolean _flag = false; public static boolean testAndClear() { boolean result = _flag; _flag = false;
1 Model Interface Implementation for Two-Way Obliviousness in Aspect-Oriented Modeling Presented by Wuliang Sun Department of Computer Science Baylor University.
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
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
1 N Degrees of Separation: Multi-Dimensional Separation of Concern (MDSOC) HyperJ: language and concepts of general concern combination.
Secure Systems Research Group - FAU Aspects and mobile applications Sergio Soares Paulo Borba, “PaDA: A Pattern for Distribution Aspects” In Second Latin.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
Aspect Oriented Programming (AOP) in.NET Brent Krueger 12/20/13.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Aspect Oriented Programming Scott Nykl CSSE 411 Senior Seminar.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 32 Slide 1 Aspect-oriented Software Development 1.
Modularizing Web Services Management with AOP María Agustina Cibrán, Bart Verheecke { Maria.Cibran, System and Software Engineering.
MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other product or service names are the property of their respective.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
CSE 219 Computer Science III Program Design Principles.
Aspect Oriented Programming Gülşah KARADUMAN.
Joel Phinney March 31, ◦ Concerns  Separation of Concerns, Tangled and Scattered Concerns, Cross-Cutting Concerns, Aspects ◦ Aspect-Oriented Software.
A Meta-Level Specification and Profile for AspectJ in UML Joerg Evermann School of Information Management Victoria University of Wellington.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Introduction Better Faster Cheaper (pick any two) On-going issue that continues to motivate research in software engineering Applications: –continue to.
Virtual Support for Dynamic Join Points C. Bockisch, M. Haupt, M. Mezini, K. Ostermann Presented by Itai Sharon
Object Oriented Software Development
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.
AspectJ – AOP for Java Tom Janofsky. Instructor at Penn State Abington Consultant with Chariot Solutions JUG Member.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Topics for exam in AOSD Basic concepts: tangling, scattering, joinpoint, advice, cross-cutting, weaving AspectJ: syntax, pointcut notations, around, proceed,
Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Object-Oriented Programming Chapter Chapter
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
Aspect Oriented Security Tim Hollebeek, Ph.D.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Adrian Colyer IBM Hursley OOPSLA, October
Applying Aspect-Orientation in Designing Security Systems Shu Gao Florida International University Center for Advanced Distributed Systems Engineering.
R R R A Brief Introduction to Aspect-Oriented Programming.
IWFST'2005, Shanghai Testing Aspect-Oriented Programs: Challenges and Opportunities Jianjun Zhao Department of Computer Science and Engineering Shanghai.
University of British Columbia Software Practices Lab Uniform Support for Modeling Crosscutting Structure Maria Tkatchenko Gregor Kiczales Work supported.
Aspect-Oriented Software Development (AOSD)
CSCE 240 – Intro to Software Engineering Lecture 3.
Aspect-oriented Code Generation Approaches Abid Mehmood & Dayang N. A. Jawawi Department of Software Engineering Faculty of Computer Science and Information.
Software Engineering Lecture 7
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Discussion with Gregor Kiczales at UBC
Aspect Validation: Connecting Aspects and Formal Methods
Structuring Adaptive Applications using AspectJ and AOM
AspectAda Aspect-Oriented Programming for Ada95
Aspect Oriented Software Design
Presentation transcript:

An Overview of Aspects Shmuel Katz Computer Science Department The Technion

Overview Motivation and Background AspectJ: the standard for AOP Some other languages Aspects and design Validating aspects Some challenges

Basic claim of AOP Pure Object-Oriented doesn ’ t work!!! Gives one central decomposition — but others are possible, and sometimes needed Cross-cutting concern: one that involves many classes/methods Tangling: code treating the concern is mixed with that for other concerns Scattering: code treating the concern is scattered throughout the system

A Personal Note: My Interest Early work on Superimpositions for distributed systems: identical motivation Part of core group of EU ’ s 6 th programme for a Network of Excellence on Aspect Oriented Software Development — beginning now … My work on aspects: connecting requirements to proof; Design for aspects in UML; Specification and Correctness for aspects

Augmentations as subjects Syntax: how to express them? Classification: What types are there? Spectative: only observes/records Regulative: affects control/ termination Invasive: changes values of existing fields Specification: what do they add, to what? Correctness/validation: how do we know they do what is intended?

Aspects and Superimpositions: Modularity for Cross-cutting For distributed: Termination detection (Regulatory) Monitoring (Spectative) Fault-tolerance (Invasive) For Object Oriented Monitoring and debugging Adding security Preventing overflow Enforcing a scheduling policy Analyzing QOS and Performance

Aspects (and esp. AspectJ) Aspects: modular units that crosscut classes Aspects are defined by aspect declarations and may include pointcut declarations: where to add/replace advice declarations: what to add or do instead Can introduce new methods, variables, code … Weave (=bind) aspect to different systems (but not entirely separated yet … )

Pointcuts A program element that identifies join points Denotes a (possibly empty) set of join points kind of join point signature of join point Can be dynamic (calls within a context, look at stack) call(void Line.setP1(Point)) Denotes the set of method call join points with this signature primitive pointcut signature

Advice Additional action to take at join points Defined in terms of pointcuts The code of a piece of advice runs at every join point picked out by its pointcut pointcut move() : call(void Line.setP1(Point)) || call(void Line.setP2(Point)); after() returning : move() { } advice typepointcut advice body parameters

Types of joinpoints and changes Method calls Changes/uses of a field (variable) Method calls while another method is active (relates to stack contents) Add code before/after/around joinpoint Replace previous with new code Often use types, fieldnames, …, from the rest of the system (not fully generic)

Advice types before Before proceeding at join point after returning After execution of a join point completes normally after throwing After execution of a join point ends abnormally (exception is thrown) after After execution of a join point (completing either way) around On arrival at join point gets explicit control over when and if program proceeds

Some History AspectJ started at Xerox Parc, in a team led by George Kiczales First presented in a paper at ECOOP97, updated at ECOOP01 Today, it is incorporated into Eclipse, and its homepage is there. Kiczales is at U. British Columbia

Obliviousness: a Basic Principle? AspectJ assumes underlying system is unaware of any aspects: no explicit hooks Aspects either are or are not applied … the system can function in either case Is this necessary, or always possible?

Languages for Aspects AspectJ — the standard, seen so far HyperJ ---IBM ’ s approach to slices (Ossher..) Treats Concerns, Less rich way of adding, but adds whole slice Composition filters Only at method calls, cleaner treatment Mehmet Askit, U. of Twente Demeter, Ceasar, Jasco, JAC, …

Hyper/J Decomposition of a system to Concerns Some concerns conform to class hierarchy — others do (and can) not Define hyperslices One logical decomposition: Company has Research, Sales, Services, etc. Another: Company has Payroll, Reporting, Managing, Work tasks Can move between decompositions

Declarative Completeness  Each concern in a hyperslice:  Must declare everything to which it refers  Don ’ t need to provide a full definition for these declarations  Thus, declaration can be abstract  Highly important because :  Every hyperslice must represent a legal java program  Creating self contained hyperslices  Reuse and replace  Can be done automatically by Hyper/J

Relationships between Hyperslices Need to define:  Composition rule: Specify how hyperslices relate to one another, which units correspond  Brings up issues like:  Are two corresponding methods …  Overriding one another?  Both executed? What order? Return value?  What if types of parameters are different?

Hyper/J VS. Aspect/J  Aspect/J is a language  Hyper/J is a tool with language elements Aspect/J supports augmentation of single model  Aspects augment classes & methods of distinguished base hierarchy  Hyper/J supports integration of multiple models  Can integrate few base hierarchies  Less rich notation for Joinpoints  Aspect/J – incremental changes only

Some language issues Dynamic aspects: are they applied only at compile time, or dynamically added or removed? (When can we weave?) Genericity: do aspects refer to elements in the underlying system, or can they be reused for many systems? Efficiency versus Expressiveness Correctness and validation: how to specify and verify/test aspects?

Aspect Oriented Software Design Beyond programming languages and implementations What should be in an aspect, or collection of aspects? How may aspects interact? Cooperate in Combinations of aspects Interfere How to capture in design stage?

Examples of Early Aspects Theme/UML: adding aspects to UML, as reusable modules to add to existing systems Can Persistence be viewed as an aspect? Answer: yes, but not if application is oblivious Web caching as an aspect Extensions to UML to describe relations among aspects in a Concern Diagram

Support for AOSD: CME IBM ’ s Concern Manipulation Environment (T.J. Watson/Hurley) for Hyper/J and AspectJ An Eclipse AOSD Environment (as an Eclipse Open Source Project?) Concern Explorer (part of JDK): finding them.. Concern Manager Concern Visualizer Concern Composition (Weaver) for multiple languages

Aspects for Components Some Aspects should be made into components (but how?) Some Components should be Aspects! Aspects can be associated with a component to allow customization Component Architectures are implemented with wrappers and capture method calls

Services of JEBs replace aspects Encryption, Authentication, Persistence can all be handled by standard services Restricted to message-call pointcuts Has a built-in fixed solution, hard to modify or configure Does isolate part of what aspects do …

Implement components using Aspects Some experiments have been done Most promising direction: keep component architecture with stubs and skeletons, and use it to implement AOSD constructs in a language-independent way A potential problem: lack of standardization in services and language support

Prominent example: JBoss JBoss is an open-source implementation of the J2EE platform Developed independently and freely distributed Full support for the latest J2EE specification Passed Sun's certification tests The following discussion is with regard to version 4.0 Currently in "developer release" stages

JBoss and Aspects The lead developers of JBoss believe that AOP "should have the same effect on software development that object-oriented programming (OOP) had years ago" B. Burke (Chief Architect) and A. Brock (Director of Support), 2003 As a J2EE platform, JBoss provides the standard EJB aspects/services However, JBoss also includes a built-in AOP framework and is written using aspects

Sources AOSD homepage: AOSD Conferences in 2002, 2003, 2004 CACM issue of October 2001 AspectJ homepage: Composition filters, Caesar, others, … Books on aspects

Topics 1a 1b – 31/10 Basic syntax, principles and examples for AspectJ and use in Eclipse (the standard aspect language) 2a – 7/11 HyperJ: language and concepts of general concern combination 2b -- HyperJ and Concern Manipulation Environment (CME) 3a – 14/11 Composition filters: an elegant message-based approach 3b -- Composition filters support environment and analysis 4a – 21/11 Demeter: interesting ideas on dynamic aspects 4b -- Ceasar: dynamic aspect application and development

Topics (cont.) 5a – 28/11 JasCo: an aspect language intended for components 5b -- JAC an environment for system development with aspects in Java 6a – 5/12 Implementation issues: advice weaving in AspectJ 6b Static analysis of aspects 7a – 12/12 Just-in-time aspects 7b Virtual machine support for dynamic joinpoints 8a 19/12 Event-based aspects in EAOP 8b Composition, reuse, and interaction of stateful aspects

Topics (cont.) 9a – 26/12 Verifying aspect advice modularly 9b – Aspect Validation and aspects for specification 10a – 2/1 Theme/UML: extending UML for aspects 10b – Architectural views of aspects in UML 11a – 9/1 Scenario-based specification of aspects 11b – Aspect requirements and traceability: Arcade /Probe 12a – 16/1 Large-scale AOSD for middleware: a case study 12b – JBOSS and aspects for middleware 13a – 23/1 AspectWerkz: a framework for AOdevelopment 13b – BBN and other frameworks for aspect development