Porting the Cuckoo's Egg
Russell Miles continues his introduction to AOP in Spring with a Cuckoo's Egg Design Pattern example. The CuckoosEgg interceptor routes method invocations to alternative implementations in his ReplacementFeature class. The example Spring AOP configuration takes nearly 60 lines of XML to say, "apply the CuckoosEgg interceptor to IBusinessLogic.foo() and IBusinessLogic2.bar()." Since Russell used the AOP Alliance API, we can reuse his same code with Dynaop and enjoy a considerably simpler BeanShell-based configuration:
interceptor(IBusinessLogic, "foo", CuckoosEgg); interceptor(IBusinessLogic2, "bar", CuckoosEgg);
And, Dynaop integrates well with the rest of Spring.
- Login or register to post comments
- Printer-friendly version
- crazybob's blog
- 971 reads





