Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generic code in action

 
mark smith
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have two class who extends DispatchAction

theses two class use the same form class

theses two class have the same action, majority of the code of this theses actions are similar

example



is there a way to use these similar code for my two class who extends DispatchAction?

thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems pretty non-Struts specific.

There are at least a couple of options:

- Create a base class with a call-out to the class-specific part
- Create a sub class that calls a non-class-specific method
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic