This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Interceptors vs. BaseActions  RSS feed

 
Junilu Lacar
Sheriff
Posts: 10883
158
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!