本文介绍了我们如何使用AspectJ实施策略模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用AOP实施策略模式吗?我想1.覆盖默认算法2.或者想动态选择任何给定算法.

Can I implement Strategy Pattern using AOP. I would like to either 1. Override the default algorithm2. Or Would like to dynamically select any of the given algorithm.

谢谢

推荐答案

请看Russell Miles撰写的"AspectJ Cookbook".从AspectJ的角度来看,它提供了几乎所有经典设计模式的实现.这是策略模式的直接链接 http://books.google.com/books?id=AKuBlJGl7iUC&lpg=PP1&pg=PA230#v=onepage&q&f=true .

Look at "AspectJ Cookbook" by Russell Miles. It provides implementation of almost all classical design patterns from the point of AspectJ's view. Here is direct link to strategy pattern http://books.google.com/books?id=AKuBlJGl7iUC&lpg=PP1&pg=PA230#v=onepage&q&f=true.

这篇关于我们如何使用AspectJ实施策略模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 00:17