Aspect Oriented Programming(AOP) 介绍
2008-05-31 23:47
316 查看
什么是AOP?
:) = Aspect Oriented Programming
Business Rule | (AOP)
Security Permission |
Logging | --------------> Business Logic
Database Operations |
Web Service |
为什么AOP?
为了独立业务
怎样AOP?
举个例子
按照传统的写法写登陆业务
1bool isAdministrator = false;
3if(Users.ValidateUser(Context.User.UserName) == UserRole.Admministrator)
4if(!isAdministrator) throw new NoPermissionExpection();
8// Bussiness Code
9if(!Memebership.User.HasPermission) throw new NoPermissionExpection();
关于动态代理的部分
例如:
[Before(Memebership.User.HasPermission)]
public void ExecuteLogic()
public class ExecuteEngine
public void Run()
// TODO:: Get the attribute to find out if there is a before attribute。
// If there is, Run the Arrtibute Method First, then run the ExecuteLogic
}
}
框架
Spring, Aspect# 等等
关于AOP更多描述:
http://www.jdon.com/AOPdesign/jdon-aop.htm
http://wayfarer.cnblogs.com/articles/241024.html
:) = Aspect Oriented Programming
Business Rule | (AOP)
Security Permission |
Logging | --------------> Business Logic
Database Operations |
Web Service |
为什么AOP?
为了独立业务
怎样AOP?
举个例子
按照传统的写法写登陆业务
1bool isAdministrator = false;
3if(Users.ValidateUser(Context.User.UserName) == UserRole.Admministrator)
4if(!isAdministrator) throw new NoPermissionExpection();
8// Bussiness Code
9if(!Memebership.User.HasPermission) throw new NoPermissionExpection();
关于动态代理的部分
例如:
[Before(Memebership.User.HasPermission)]
public void ExecuteLogic()
public class ExecuteEngine
public void Run()
// TODO:: Get the attribute to find out if there is a before attribute。
// If there is, Run the Arrtibute Method First, then run the ExecuteLogic
}
}
框架
Spring, Aspect# 等等
关于AOP更多描述:
http://www.jdon.com/AOPdesign/jdon-aop.htm
http://wayfarer.cnblogs.com/articles/241024.html
相关文章推荐
- AOP(Aspect Oriented Programming) 面向方面编程
- AOP(Aspect Oriented Programming)面向切面编程及应用实例
- Aspect Oriented Programming(AOP)面向切面编程
- Java 面向切面编程(Aspect Oriented Programming,AOP)
- AOP(面向切面编程 Aspect Oriented Programming)
- Spring AOP(aspect oriented programming) 转载
- AOP(Aspect Oriented Programming)是什么?
- AOP(Aspect Oriented Programming,面向方面编程)
- AOP--Aspect Oriented Programming
- Aspect Oriented Programming(AOP)面向切面编程+OOD = Object Oriented Design OOP = Object Oriented ProgrammingOOP(面向对象编程)
- Aspect Oriented Programming (AOP)
- AOP Aspect Oriented Programming
- 012. Spring Aspect Oriented Programming(AOP)
- AOP(Aspect Oriented Programming)是什么?
- 关于spring.net的面向切面编程 (Aspect Oriented Programming with Spring.NET)-使用工厂创建代理(Using the ProxyFactoryObject to create AOP proxies)
- Aspect Oriented Programming using Interceptors within Castle Windsor and ABP Framework AOP
- AOP(Aspect Oriented Programming)面向切面编程,aop解决的问题是什么(AOP模拟)
- AOP为Aspect Oriented Programming的缩写,意为:面向切面编程
- aop(Aspect Oriented Programming)面向切面编程
- Aspect Oriented Programming (AOP)