Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Interceptors vs. BaseActions

 
Junilu Lacar
Marshal
Posts: 10377
123
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Been looking at the Struts Action Invocation Framework and was wondering if the Interceptors would make it unnecessary to have all your Actions extend a BaseAction. Haven't seen too many examples of how these things are used so if anybody has experiences/thoughts on this to share it would much appreciated.
Thanks!
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I don't think so. You will still want to have BaseActions to provide common functionality to your Actions. However, Interceptors are useful for declaratively tacking on orthogonal services to your application easily. It is a poor man's AOP with a very limited pointcut selection. Therefore, I don't see Interceptors replacing BaseActions any more than I see AOP replacing Inheritance.
If you are interested in Interceptors then I suggest you checkout XWork/WebWork2... it is built into the framework and they did a much better job of it.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!