Introduction to AOP.

Slides:



Advertisements
Similar presentations
Jim McKeeth | Podcast at Delphi.org
Advertisements

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.
1 JAC : Aspect Oriented Programming in Java An article review by Yuval Nir and Limor Lahiani.
Aspect Oriented Programming - AspectJ Radhika Rajput.
NCSoft China PD Dept. training - Session 4 -- Lance Zhang
Spring, Hibernate and Web Services 13 th September 2014.
Overview of AspectJ Aspect Oriented Software Development Seminar Technion presented by Oren Mishali.
Copyright © 2008 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. Andrew Stone Common Security.
Aspect-Oriented Programming In Eclipse ® Aspect-Oriented Programming in Eclipse with AspectJ Dr Helen Hawkins and Sian January.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
October - December 2013CSC5021: The Problem With Aspects (J P Gibson)1 The Problem With Aspects (AOP) A style of programming that attempts to abstract.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 4.0.
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.
© 2005, Cornell University. Rapid Application Development using the Kuali Architecture (Struts, Spring and OJB) A Case Study Bryan Hutchinson
Apache Axis: A Set of Java Tools for SOAP Web Services.
1 FM Overview of Adaptation. 2 FM RAPIDware: Component-Based Design of Adaptive and Dependable Middleware Project Investigators: Philip McKinley, Kurt.
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
CPSC 372 John D. McGregor Module 3 Session 2 Architecture Analysis/Design.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
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.
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
CSE 219 Computer Science III Program Design Principles.
(Business) Process Centric Exchanges
Aspect Oriented Programming Gülşah KARADUMAN.
Methodology: The AOP Refactoring Process Aspect-Oriented Refactoring of the Apache Cocoon Shared-Object Resource Allocation System Jeff Dalton Advisor:
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
AOP-1 Aspect Oriented Programming. AOP-2 Aspects of AOP and Related Tools Limitation of OO Separation of Concerns Aspect Oriented programming AspectJ.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Introduction Better Faster Cheaper (pick any two) On-going issue that continues to motivate research in software engineering Applications: –continue to.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com.
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.
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
Click to edit Master text styles JavaMOP Hamid Reza Niroomand A presentation to Dr. Babamir.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
Introduction to Yan Cui Aspect Oriented Programming by
Objects First With Java A Practical Introduction Using BlueJ Designing classes How to write classes in a way that they are easily understandable, maintainable.
1 COS 260 DAY 12 Tony Gauvin. 2 Agenda Questions? 5 th Mini quiz –Chapter 5 40 min Assignment 3 Due Assignment 4 will be posted later (next week) –If.
R R R A Brief Introduction to Aspect-Oriented Programming.
L’origine dei mali: le dipendenze tra componenti Stefano Leli 14° Workshop DotNetMarche Venerdì 16 aprile
 Is a programming paradigm  Extends OOP  Enables modularization of cross cutting concerns.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 6.0.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
Leveraging ColdSpring to build a robust Flex applications Chris Scott, Cynergy Systems.
Callbacks and Interceptors. Contents  Session Beans Life Cycle  Interceptors.
#1 pattern-aware compiler extension to C#/VB
Software Engineering Lecture 7
Aspect-oriented programming
Behavioral Design Patterns
Aspect-Oriented Programming with the Eclipse AspectJ plug-in
Objects First with Java
Implementation of the INFOD System using AOP
JAsCo an Aspect-Oriented approach tailored for
Aspect-oriented programming
AspectAda Aspect-Oriented Programming for Ada95
Presentation transcript:

Introduction to AOP

which aims to increase modularity by allowing the separation of Programming paradigm which aims to increase modularity by allowing the separation of cross-cutting concerns en.wikipedia.org/wiki/aspect-oriented-programming Programming paradigm which aims to increase modularity by allowing the separation of cross-cutting concerns en.wikipedia.org/wiki/aspect-oriented-programming

Programming Paradigm It is It is *NOT* - a programming pattern - a tool in your toolbox - an easily added language feature - complimentary to OOP It is *NOT* a programming language solution to all your problems a first class citizen in Java or .NET a replacement for OOP

Modularity Aspects can… Exist in isolated and encapsulated constructs Be attached to almost any standard code construct Be transported between projects

Cross-Cutting Concerns …aspects of a program that affect other concerns. These concerns often cannot be cleanly decomposed from the rest of the system in both the design and implementation, and can result in either scattering (code duplication), tangling (significant dependencies between systems), or both. http://en.wikipedia.org/wiki/Cross-cutting_concern

…more simply Any code functionality that repeats itself in a regular pattern across many unrelated tiers/layers within a codebase.

Cross-Cutting Concerns View INotifyPropertyChanged ViewModel Logging Security Validation Undo/Redo Model Thread Management Services Auditing Unit of Work Management Domain Model Circuit Breaker Repositories

AOP Styles Interception IL Weaving Interjecting the execution of cross-cutting concerns at run time. Non-invasive approach to modifying the code execution path. IL Weaving Interjecting the planned execution of cross-cutting concerns during the compilation process. Invasive approach to modifying the code execution path.

Interception Existing in IoC container implementations Follows a very strict decorator pattern Likely implemented using weak typing Run-time operation Can be applied en-masse Easy to implement if you’re already using IoC

Decorator Pattern //new functionality before //the code that already exists //new functionality after //exception handling

Weak Typing

En-masse Attachment

IL Weaving Post compilation process Alters the assembly/executable at an IL level Scary to people Can be attached to almost every code construct Very rare that it required changes to existing code Run and compile time operations Can be much easier to add to legacy code

AOP post compiler/weaver The Process Write Code Compile Application exe/dll Throw compile-time error AOP post compiler/weaver Deploy exe/dll

Constructs Methods (private/public/internal/etc) Properties Field level variables Events Event registration/de-registration Code generation

Run Time vs Compile Time All aspect code executes in application context Compile Time Code can be designated to run during post-compilation Compilation can fail for correct syntaxes but incorrect business logic

Tooling Interception IL Weaving Castle Winsdor StructureMap Ninject (with Ninject.Extensions) AutoFac (with Autofac.Extras) IL Weaving PostSharp (current) LinFu

The Traditional Arguments Against AOP It is “magic” We won’t be able to debug properly How do we know where aspects will be executed? It’s another thing we have to learn Changing the aspect will break the entire application

“Its magic!” & “We can’t debug it!” Both interception and IL weaving provide full line-by-line debugging Attachment of aspects is explicit as you want it to be

“But which aspect(s) will run?” This is a tooling/discoverability problem, not a problem with AOP itself PostSharp has very good VS integration showing what aspects are attached to a piece of code Interceptor discoverability is a bigger problem

“Its another thing we have to learn” Is it worse if we train them and they leave or if we don’t train them and they stay?

“Changing the aspect can break the entire application!” You can probably do that in an number of different ways with any codebase that doesn’t use AOP This is a problem caused by tight coupling and poor separation of concerns

Your Project is Already Established… You use IoC For logging, caching and possibly transaction management use interception If the cross cutting concerns are more complex (Undo/Redo, thread management) use IL Weaving You don’t use IoC The only real option is to use IL Weaving

You’re Starting a New Project… You have AOP buy-in from senior developers Start with IL Weaving, but start with simple, pre-built aspects Write custom aspects as experience and need grows AOP is still unknown to the senior people on the team Start with IL Weaving, but start in a very isolated manner Use this as a proof of concept until you have senior level buy- in

gracias Donald Belcham donald.belcham@igloocoder.com