How can we implement Strategy Pattern using AspectJ

≯℡__Kan透↙ 提交于 2019-12-23 03:42:18

问题


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

Thanks,


回答1:


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.



来源:https://stackoverflow.com/questions/7244165/how-can-we-implement-strategy-pattern-using-aspectj

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!