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

问题描述

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

Can I implement Strategy Pattern using AOP. I would like to either1. 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 实现策略模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 09:53
查看更多