19.12.2006 1 Aspect Oriented Programming Gülşah KARADUMAN.

Slides:



Advertisements
Similar presentations
A Brief Introduction to Aspect-Oriented Programming Zhenxiao Yang.
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
ASTA Aspect Software Testing Assistant Juha Gustafsson, Juha Taina, Jukka Viljamaa University of Helsinki.
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.
Aspect Oriented Programming - AspectJ Radhika Rajput.
Secure Systems Research Group - FAU Aspect Oriented Programming Carlos Oviedo Secure Systems Research Group.
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
Java.sun.com/javaone/sf | 2004 JavaOne SM Conference | Session BUS JavaOne 2004 What is AOP? Gregor Kiczales AspectMentor.com and University of.
1 Aspect Oriented Programming Programming Languages Seminar Presenter: Barış Aktemur University of Illinois 18 Feb Mostly taken from Bedir Tekinerdogan’s.
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.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Aspect-oriented programming Laura Ricci A.A
Aspect Oriented Programming Written by Michael Beder.
(c) Copyright Palo Alto Research Center Incroporated. All rights reserved.1 AO Tools: State of the (AspectJ™) Art and Open Problems Mik Kersten.
Software modularity group Gregor Kiczales Professor and NSERC/Xerox/Sierra Systems Software Design Chair University of British Columbia Principal Scientist.
Outline Introduction Problem Statement Object-Oriented Design Aspect-Oriented Design Conclusion Demo.
Object Oriented Programming Development
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Introduction to Aspect Oriented Programming Presented By: Kotaiah Choudary. Ravipati M.Tech IInd Year. School of Info. Tech.
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.
1 An Aspect-oriented Weaving Mechanism Based on Component-and-Connector Architecture Naoyasu Ubayashi (Kyushu Institute of Technology) February 12, 2008.
©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.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
1 Life Cycle of Software Specification Design –Risk Analysis –Verification Coding Testing –Refining –Production Maintenance.
Kiczales and Mezini - FOAL AOP and Modular Reasoning [ICSE05] Start with first-principles definition of modularity and modular reasoning –localization,
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
AOSD1 Aspect-Oriented Software Design Karl Lieberherr Theo Skotiniotis.
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.
Devon M. Simmonds Computer Science Department, CSC592 1 Devon M. Simmonds Computer Science Department University of North Carolina, Wilmington
Aspect-Oriented Programming An Introductory Presentation Mike Landi MSCS Candidate Union University.
Aspect-Oriented Programming and Modular Reasoning G. KiczalesM. Mezini Presented by Alex Berendeyev.
IDENTIFYING SEMANTIC DIFFERENCES IN ASPECTJ PROGRAMS Martin Görg and Jianjun Zhao Computer Science Department, Shanghai Jiao Tong University.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
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.
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Aspect-Oriented Software Development (AOSD)
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
AOP-Driven Variability in Software Product Lines Vander Alves, Ayla Dantas, and Paulo Borba Informatics Center – UFPE – Brazil
Comparison of Different AOP Approaches Presented by: Xiaojing Wang.
aspectj tools new and noteworthy Mik Kersten University of British Columbia Adrian Colyer IBM Hursley OOPSLA, October
Introduction to Yan Cui Aspect Oriented Programming by
R R R A Brief Introduction to Aspect-Oriented Programming.
Introduction to Aspect- Oriented Programming CS 3360 Gregor Kiczales, et. al. Getting started with AspectJ, CACM, 44(10):59-65, October Spring 2012.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
CSC450 Software Engineering Devon M. Simmonds University of North Carolina, Wilmington 1.
Aspect-Oriented Software Development (AOSD)
AspectJ Development Tools Mik Kersten University of British Columbia October 28, 2003.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
L’origine dei mali: le dipendenze tra componenti Stefano Leli 14° Workshop DotNetMarche Venerdì 16 aprile
SE 510 Principles and Applications of Software Design Aspect Oriented Programming October 5, 2005 Jeff Webb.
Aspect-oriented programming
An Interface Mechanism for Encapsulating Weaving in Class-based AOP
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Object-Orientated Programming
Aspect-Oriented Programming
A Brief Introduction to Aspect-Oriented Programming
Structuring Adaptive Applications using AspectJ and AOM
Aspect-oriented programming
AspectAda Aspect-Oriented Programming for Ada95
Aspect Oriented Software Design
Refactoring the Aspectizable Interfaces: An Empirical Assessment
Presentation transcript:

Aspect Oriented Programming Gülşah KARADUMAN

Outline Introduction The Problem Goal of AOP Programming with Aspects AspectJ Conclusions

Background Information Functional decomposition  Break the system into smaller units Programming languages  Define abstractions for the small units  Compose the units into systems

Procedure Based Languages Functional, Procedural, OO Comfortable to talk about what is encapsulated as a functional unit of the overall system What about the units of decomposition that are not functional

Modularity Abstraction Decomposition Encapsulation Information Hiding Separation of Concerns  Low coupling  High cohesion

Concerns Particular goal, concept, or area of interest Primary motivation for organizing and decomposing software into manageable and comprehensible parts

Separation of Concerns Cohesion  Maximize cohesion within a component Coupling  Minimize coupling between components

Separation of Concerns Advantages  Understandability  Reusability  Extensibility  Maintainability  Adaptability

The Problem Limitations of OOP  decomposition resulting in cross-cutting concerns Insufficieny of OO and procedural development techniques

Crosscutting, Scattering, and Tangling Crosscutting  Concerns inherently relating to multiple components Scattering  Single concern affecting multiple modules Tangling  Multiple concerns interleaved in a single module

Crosscutting Concern Examples Synchronization Real-time constraints Error-checking Object interaction constraints Memory management Persistency Security Caching Logging Monitoring Testing Domain specific optimization

Crosscutting Concern Examples Display Figure FigureElement * PointLine getX() getY() getP1 setP1 DisplayTracking setX(int) setY(int) setP1(Point) setP2(Point) 2

Cost of Crosscutting Concerns Reduced understandability Decreased adaptability Decreased reusability Decreased maintainability

Component Cleanly encapsulated in a generalized procedure (i.e. object, method, procedure, API) Well-localized, and easily accessed and composed

Aspect Properties that affect the performance or semantics of the components in systemic ways Not cleanly encapsulated in a generalized procedure

Goal of AOP Separate components and aspects from each other Abstract and compose the components and aspects to produce the overall system

AOP A promising new technology for separating crosscutting concerns that are usually hard to do in object-oriented programming

Fundamentals of AOP Aspect as a modularization unit Three distinct development steps:  Aspectual decomposition  Concern implementation  Aspectual recomposition

Steps of AOP

Programming with Aspects Writing the components Writing the aspects Weaving

Aspect Weaving

Tools for AOP AspectJ AspectC++ AspectWerkz JAC JBoss-AOP Nanning

AspectJ Small, well-integrated extension to Java  Java programs as input .class files compatible with any JVM as output Free and open source AspectJ compiler

AspectJ Terminology Join point Pointcut Advice Introduction Aspect

Join Points Well-defined points in a program's execution Key points in dynamic call graph

Pointcuts A named collection of join points Designate join points

Advice Before advice After advice Around advice

Introduction Modifies  Members of a class  Relationship between classes

Aspect Module for handling crosscutting concerns  Defined in terms of pointcuts, advice, and introduction  Reusable and inheritable

class Line { private Point _p1, _p2; Point getP1() { return _p1; } Point getP2() { return _p2; } void setP1(Point p1) { Tracer.traceEntry(“entry setP1”); _p1 = p1; Tracer.traceExit(“exit setP1”); } void setP2(Point p2) { Tracer.traceEntry(“entry setP2”); _p2 = p2; Tracer.traceExit(“exit setP2”); } class Point { private int _x = 0, _y = 0; int getX() { return _x; } int getY() { return _y; } void setX(int x) { Tracer.traceEntry(“entry setX”); _x = x; Tracer.traceExit(“exit setX”) } void setY(int y) { Tracer.traceEntry(“exit setY”); _y = y; Tracer.traceExit(“exit setY”); } Example – Without AOP Tangling Code Scattered Concern class Tracer { static void traceEntry(String str) { System.out.println(str); } static void traceExit(String str) { System.out.println(str); } }

class Line { private Point _p1, _p2; Point getP1() { return _p1; } Point getP2() { return _p2; } void setP1(Point p1) { _p1 = p1; } void setP2(Point p2) { _p2 = p2; } class Point { private int _x = 0, _y = 0; int getX() { return _x; } int getY() { return _y; } void setX(int x) { _x = x; } void setY(int y) { _y = y; } Example - AspectJ aspect Tracing { pointcut traced(): call(* Line.* || call(* Point.*); before(): traced() { println(“Entering:” + thisjopinpoint); after(): traced() { println(“Exit:” + thisjopinpoint); void println(String str) { } } pointcut advice aspect Aspect is defined in a separate module Crosscutting is localized No scattering; No tangling Improved modularity

Advantages of AOP  Tractability  Simpler cleaner code  Reusability  Easier to maintain

Disadvantages of AOP Difficult to understand a software because of invisibly injected aspects Fragile build problems Complicated control flow breakage Reduced quality of software if aspects are not appropriately managed

Conclusions Scattered crosscutting concerns over several modules causing tangling code Explicit abstraction mechanism with AOP  Increased modularity of the system

References 97aspectoriented.pdf oriented_programming hp/

Thank you for your attention! Questions?