AspectJ Basics
Covers the understanding of AspectJ basic concepts:
- Know what a Cross Cutting Concern (CCC) is
- Understand the advantages and disadvantages of using aspect oriented programming
- Differentiate and identify basic join points, namely call, execution, get and set
- Understanding that CCCs can appear in other programming languages, modelling languages and use cases (or just about any structured document).
Programming AspectJ theory
Covers theoretical basic knowledge of AspectJ :
- Understand what an advice does, and how to use before, after and around advice in various scenarios
- Understand the weaving process :
- Define load time and compile time weaving
- Explain why the classes exposed to be weaved must be exposed to the weaver
- Know that aspects can be declared using a specific grammar or in common Java using annotations
Basic AspectJ grammar
Covers basic knowledge of AspectJ grammar :
- Write code that defines an aspect
- Write code that defines simple pointcuts
- Using call, execution, get and set
- Using class and member patterns
- Define and use a named pointcut
- Detect the differences between call and execution join points, one of the most common beginner problems.
- Write code that defines an advice, using either before, after or around
More about AspectJ aspects
Covers more advanced topics about aspects in general :
- Write code using aspect libraries
- Write and aspect extending an abstract aspect
- Write code using AspectJ API and Java extension, namely proceed() and thisJoinPoint
- Write a pointcut combining different pointcuts and understand how to use && and || in pointcuts.
Parameters
Covers extraction of
parameters from pointcuts and usage of parameters in advice :
- Use the args() pointcut to extract parameters
- Use this() and target()
- Declare an advice with parameters and bind them to those declared in a pointcut
Basic intertype declarations
Covers how AspectJ can be used to define a member of an existing class that conceptually belongs to a crosscutting concern (i.e., an aspect)
- Define a new field on an existing class
- Define a new method on an existing class
- Define an annotation on an existing class or class member
- Define a new interface on an existing class
- Explain how the access modifiers (private, protected etc..) present in Java have different semantics when applied to intertype declared members. Especially, how a private field will be private to the aspect, and not the target class.
@AspectJ style
Covers how to use
annotations to define aspects
- Know that @AspectJ style only allows compilable Java code
- Write code style aspects translating from @AspectJ style aspects
分享到:
相关推荐
AspectJ Android Example ...Basic usage of aspect for auth-based method call CachingAspect Fetch an image and implemented simple caching using aspect ExceptionHandlingAspect Catch all exce
14.2. AspectJ (JoinPoint) 安全拦截器 15. 基于表达式的权限控制 15.1. 概述 15.1.1. 常用内建表达式 15.2. Web 安全表达式 15.3. 方法安全表达式 15.3.1. @Pre 和@Post 注解 15.3.1.1. 访问控制使用...
14.2. AspectJ (JoinPoint) 安全拦截器 15. 基于表达式的权限控制 15.1. 概述 15.1.1. 常用内建表达式 15.2. Web 安全表达式 15.3. 方法安全表达式 15.3.1. @Pre 和 @Post 注解 15.3.1.1. 访问控制...
14.2. AspectJ (JoinPoint) 安全拦截器 15. 基于表达式的权限控制 15.1. 概述 15.1.1. 常用内建表达式 15.2. Web 安全表达式 15.3. 方法安全表达式 15.3.1. @Pre 和 @Post 注解 15.3.1.1. 访问控制使用 @...
2.3.4. 对AspectJ装载时织入(AspectJ load-time weaving)的支持 2.4. 中间层 2.4.1. 在XML里更为简单的声明性事务配置 2.4.2. 对Websphere 事务管理的完整支持 2.4.3. JPA 2.4.4. 异步的JMS 2.4.5. JDBC ...
2.3.4. 对AspectJ装载时织入(AspectJ load-time weaving)的支持 2.4. 中间层 2.4.1. 在XML里更为简单的声明性事务配置 2.4.2. 对Websphere 事务管理的完整支持 2.4.3. JPA 2.4.4. 异步的JMS 2.4.5. JDBC ...
25.2 AspectJ(JoinPoint)安全拦截器 198 26.基于表达式的访问控制 200 26.1概述 200 26.1.1通用内置表达式 201 26.2网络安全表达式 202 26.2.1在Web安全表达式中引用Bean 203 26.2.2 Web安全表达式中的路径变量 ...
52. <tx:annotation-driven mode="aspectj"/> 53. 54. <aop:aspectj-autoproxy/> 55.</beans> hibernate.properties数据库连接配置 [java] view plaincopy 01.dataSource.password=123 02....
Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................
Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................
4.5. Injecting AspectJ aspects 4.6. Summary 2. Spring on the web Chapter 5. Building Spring web applications 5.1. Getting started with Spring MVC 5.1.1. Following the life of a request 5.1.2. Setting ...