How to implement Abstract Factory pattern in Spring-AOP?
Is implementing开发者_高级运维 the Abstract Factory pattern for a spring-based project with AOP should be any different than in a normal project?
It should be simpler, all things considered; technically, Spring acts like an Abstract Factory itself, and that pattern deeply informs most things that Spring "wants" you to do with it.
Without a more concrete example, I'd have to say "no". Spring AOP is pretty good at working around your code, whatever structure it's in.
Depends on your AOP. If you're using AspectJ with load time or compile time weaving, then you don't have an issue. If you're using the spring based AOP, then you have an issue because spring will only put aspects onto beans it creates. Meaning that if your factory makes the bean, it won't have any AOP instrumentation
精彩评论