现在的位置: 首页 > 综合 > 正文

spring AOP策略模式使用

2013年06月16日 ⁄ 综合 ⁄ 共 278字 ⁄ 字号 评论关闭

1.策略模式

The Strategy Pattern defines a family of algorithms,encapsulates each one,and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it

          策略模式UML图

 

2.策略模式组成

—抽象策略角色: 策略类,通常由一个接口或者抽象类实现。
—具体策略角色:包装了相关的算法和行为。
—环境角色:持有一个策略类的引用,最终给客户端调用。
 
3.spring AOP策略模式使用

抱歉!评论已关闭.