SlideShare uma empresa Scribd logo
1 de 26
18/10/2013


Aspect oriented programming (AOP) allows us to keep
implement different concerns in isolation



Cross-cutting concerns are conceptually separate from (but
often embedded directly within) the application’s business
logic. Separating these cross-cutting concerns from the
business logic is where aspect- oriented programming
(AOP) goes to work.



Whereas DI helps you decouple your application objects
from each other, AOP helps you decouple cross-cutting
concerns from the objects that they affect.










Centralize concerns implementation
More reusable code
Cleaner code
Write less code
Easy to understand
More maintainable
Less boilerplate code
More interesting work
Caching

Profiling


Aspects are often described in terms of
advice, pointcuts, and join points.







Advice defines what needs to be applied and
when.
Jointpoint is where the advice is applied.
Pointcut is the combination of different
joinpoints where the advice needs to be
applied.
Aspect is applying the Advice at the
pointcuts.
Advice

Method

Joinpoints

Logger

Method

Transaction
Manager

Concern

Method

Concern


Before Advice



After Advice



After returning Advice



Around Advice



Throws Advice

Method

Method

Method
Method

Exception




your application may have thousands of
opportunities for advice to be applied. These
opportunities are known as join points.
These are the points where your aspect’s
code can be inserted into the normal flow of
your application to add new behavior.


Pointcuts help nar- row down the join points
advised by an aspect. If advice defines the
what and when of aspects, then pointcuts

define the where

pointcut move():
call(void Line.setP1(Point)) ||
call(void Line.setP2(Point));


An aspect is the merger of advice and
pointcuts. Taken together, advice and pointcuts define everything there is to know about
an aspect—what it does and where and when

it does it.


Weaving is the process of applying aspects to a target object to create a new
proxied object. The aspects are woven into the target object at the specified

join points. The weaving can take place at several points in the target object’s
lifetime:
◦ Compile time —Aspects are woven in when the target class is compiled.
◦ Classload time —Aspects are woven in when the target class is loaded into
the JVM.
◦ Runtime —Aspects are woven in sometime during the execution of the
applica- tion. Typically, an AOP container will dynamically generate a proxy

object that will delegate to the target object while weaving in the aspects.


saveCustomer(cus)
CustomerService

Customer
DAO

Proxy

Logger(Aspect)


AspectJ



AspectWrekz



JBossAOP



Spring AOP
1.

Spring AOP (using XML)

2.

Spring AoP ( using AspectJ Annotations)

3.

AspectJ ( using aspect class)
– An Logger Example






Cuts across multiple abstractions
Difficult to decompose
High-coupling
Boilerplate code
Code tangling and scattering
◦
◦
◦
◦

Poor traceability
Lower productivity
Less code reuse
Harder refactoring
AspectJ

Advice
advice body

pointcut

join point

Java Program










call(method signature)
handler(exception name)
cflow(join point designator)
this(type name)
target(type name)
within(class name)
execution(method signature)
get(signature), set(signature)
initialization(signature),
staticinitialization(type name)








call(* foo())
call(public bar.*(..))
call(void foo(..))
call(* *(..))
call(*.new(int, int))
handler(File*Exception)
Aspect Oriented Programming
Aspect Oriented Programming

Mais conteúdo relacionado

Mais procurados

Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design PatternSanae BEKKAR
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignYoung-Ho Cho
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life CycleAbhishek Sur
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General IntroductionAsma CHERIF
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationabhishek singh
 
Core Java Equals and hash code
Core Java Equals and hash codeCore Java Equals and hash code
Core Java Equals and hash codemhtspvtltd
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!Jakub Kubrynski
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android applicationNikunj Dhameliya
 
Solve cross cutting concerns with aspect oriented programming (aop)
Solve cross cutting concerns with aspect oriented programming (aop)Solve cross cutting concerns with aspect oriented programming (aop)
Solve cross cutting concerns with aspect oriented programming (aop)Siva Prasad Rao Janapati
 

Mais procurados (20)

Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design Pattern
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Fragment
Fragment Fragment
Fragment
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Asp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentationAsp.net and .Net Framework ppt presentation
Asp.net and .Net Framework ppt presentation
 
Core Java Equals and hash code
Core Java Equals and hash codeCore Java Equals and hash code
Core Java Equals and hash code
 
Java servlets
Java servletsJava servlets
Java servlets
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
UML
UMLUML
UML
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android application
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
REST API
REST APIREST API
REST API
 
Solve cross cutting concerns with aspect oriented programming (aop)
Solve cross cutting concerns with aspect oriented programming (aop)Solve cross cutting concerns with aspect oriented programming (aop)
Solve cross cutting concerns with aspect oriented programming (aop)
 

Destaque

Introduction To Aspect Oriented Programming
Introduction To Aspect Oriented ProgrammingIntroduction To Aspect Oriented Programming
Introduction To Aspect Oriented Programmingsaeed shargi ghazani
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented ProgrammingRodger Oates
 
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)Yan Cui
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETYuriy Guts
 
Introduction to Aspect Oriented Programming
Introduction to Aspect Oriented ProgrammingIntroduction to Aspect Oriented Programming
Introduction to Aspect Oriented ProgrammingYan Cui
 

Destaque (6)

Introduction To Aspect Oriented Programming
Introduction To Aspect Oriented ProgrammingIntroduction To Aspect Oriented Programming
Introduction To Aspect Oriented Programming
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)Introduction to Aspect Oriented Programming (DDD South West 4.0)
Introduction to Aspect Oriented Programming (DDD South West 4.0)
 
AOP
AOPAOP
AOP
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NET
 
Introduction to Aspect Oriented Programming
Introduction to Aspect Oriented ProgrammingIntroduction to Aspect Oriented Programming
Introduction to Aspect Oriented Programming
 

Semelhante a Aspect Oriented Programming

AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC TeamAOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC TeamThuy_Dang
 
Spring AOP
Spring AOPSpring AOP
Spring AOPcteguh
 
Introduction to Spring
Introduction to SpringIntroduction to Spring
Introduction to SpringSujit Kumar
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
Spring - Part 3 - AOP
Spring - Part 3 - AOPSpring - Part 3 - AOP
Spring - Part 3 - AOPHitesh-Java
 
Aspect Oriented Software Development
Aspect Oriented Software DevelopmentAspect Oriented Software Development
Aspect Oriented Software DevelopmentJignesh Patel
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPPawanMM
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppKaty Slemon
 
Performance analysis of synchronisation problem
Performance analysis of synchronisation problemPerformance analysis of synchronisation problem
Performance analysis of synchronisation problemharshit200793
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type scriptRavi Mone
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNicole Gomez
 

Semelhante a Aspect Oriented Programming (20)

Spring AOP
Spring AOPSpring AOP
Spring AOP
 
spring aop
spring aopspring aop
spring aop
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Spring AOP in Nutshell
Spring AOP in Nutshell Spring AOP in Nutshell
Spring AOP in Nutshell
 
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC TeamAOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
AOP-IOC made by Vi Quoc Hanh and Vu Cong Thanh in SC Team
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Spring aop
Spring aopSpring aop
Spring aop
 
Introduction to Spring
Introduction to SpringIntroduction to Spring
Introduction to Spring
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Spring - Part 3 - AOP
Spring - Part 3 - AOPSpring - Part 3 - AOP
Spring - Part 3 - AOP
 
Aspect Oriented Software Development
Aspect Oriented Software DevelopmentAspect Oriented Software Development
Aspect Oriented Software Development
 
Session 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOPSession 45 - Spring - Part 3 - AOP
Session 45 - Spring - Part 3 - AOP
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
 
Performance analysis of synchronisation problem
Performance analysis of synchronisation problemPerformance analysis of synchronisation problem
Performance analysis of synchronisation problem
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Spring aop
Spring aopSpring aop
Spring aop
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
 
Objective-C
Objective-CObjective-C
Objective-C
 

Último

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 

Último (20)

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 

Aspect Oriented Programming

Notas do Editor

  1. Intercept method callsInject new behaviour
  2. Profiling  is a form of dynamic program analysis that measures space (memory) or time complexity of a program, the usage of particular instructions, or frequency and duration of function calls. The most common use of profiling information is to aid program optimization.Pooling  http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html
  3. Join points are places in your code where an aspect can be inserted, for example, before and after a method call, when a method excepts, or when field or property is being accessed.An advice is a piece of code that can be injected at join points to add new behaviour.This is the boilerplate that you had taken out from your code so that you can encapsulate it into an aspect and then inject it in whilst keeping your code pretty.A point cut is a set of join points where an advice can be applied. It can be attribute drive, like the earlier example of ‘GetBookById’ method where we applied the two attributes to the method.Or it can be filter driven, like the second example where we applied the attributes to the class instead and targeted methods that met our criteria.When a point cut is matched, advice can be executed.An aspect contains point cuts and advice, it is to AOP what class is to OOP, whereas classes holds methods and properties, aspects holds point cuts and advice.Weaving is the process of taking the advice and injecting them into the point cuts in the core component and compose the final result.
  4. Spring aspects can work with five kinds of advice: Before—The advice functionality takes place before the advised method is invoked. After—The advice functionality takes place after the advised method completes, regardless of the outcome. After-returning—The advice functionality takes place after the advised method successfully completes.  After-throwing—The advice functionality takes place after the advised method throws an exception.  Around—The advice wraps the advised method, providing some functionality before and after the advised method is invoked. Syntax-----------before(param) : pointcut(param) {body}after(param) : pointcut(param) {body}after(param) returning []: pointcut(param) {body}after(param) throwing []: pointcut(param) {body}type around(param) [throws typelist] : pointcut(param) {body}
  5. Compile time—Aspects are woven in when the target class is compiled. This requires a special compiler. AspectJ’s weaving compiler weaves aspects this way. Classload time—Aspects are woven in when the target class is loaded into the JVM. This requires a special ClassLoader that enhances that target class’s byte- code before the class is introduced into the application. AspectJ 5’s load-time weaving (LTW) support weaves aspects in this way. Runtime—Aspects are woven in sometime during the execution of the applica- tion. Typically, an AOP container will dynamically generate a proxy object that will delegate to the target object while weaving in the aspects. This is how Spring AOP aspects are woven.
  6. http://www.intertech.com/Blog/secrets-of-the-spring-aop-proxy/