概念
IoC
定义 控制反转 Inversion of Control
原理 容器控制
[1]创建、管理:外部资源
[2]创建、查找:依赖对象
[3]配置、注入:组合对象
AOP
定义 面向切面编程 Aspect Oriented Programming
原理 通过预编译方式、运行期动态代理实现程序功能
特性
[1]减少重复代码
[2]降低模块耦合
组成
[1]Aspect 切面 封装公共行为的可重用模块
[2]PointCut 切点
[3]Advice 通知
[4]JointPoint 切点
应用
[1]Transactions 事务
[2]Authentication 认证
[3]Logging 日志记录
[4]Error Handling 错误处理
[5]Context Passing 内容传递
[6]Performace 性能优化统计
[7]Caching 缓存
[8]ResourcePool 资源池
[9]Synchronization 同步
[10]Lazy Loading 延迟加载
区别
OOP 抽象封装业务处理过程 实体
AOP 抽象封装业务处理过程 行为