• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ActionForms, Polymorphism and Redirects

 
Ranch Hand
Posts: 96
Scala VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am familiar with the basics of MVC and using Struts as the presentation layer. I'm having difficulty applying OOP principles to my project to implement an extensible, maintainable design.

I am trying to design a system that receives applications of various types and stores the info in a db. There are elements of each application that are similar, which lends itself to a base-derived structure for the ActionForms(?). Of course, I'd need to go to different jsp pages to collect different information based on the type of application that is being processed.

Does anyone have any tips on books/websites/examples that would be an aid for this type of problem?

Any help is greatly appreciated.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An excellent free resource called "Struts Survival Guide" by Srikanth Shenoy has just been made available for download at http://www.objectsource.com.

If you have a number of forms that are similar with minor variations, I'd suggest writing an ActionForm containing common elements to all the forms, and then making your individual ActionForms subclasses of this form, rather than ActionForm.
 
Samuel Cox
Ranch Hand
Posts: 96
Scala VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. I will check out the website that you suggest.

As to the base ActionForm, I'm more concerned with programming my Action classes so that I'm not always using this construct:



and so on. All of these application types will gather information in similar ways but will contain different elements. Each application subtype will be implementing abstract methods such as validate(), save(), etc.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a similar problem.Maybe you guys could help.Since cross posting/multiple posting is prohibited ,kindly visit this link for my case
My Action Form Design issue.
Can you kindly take a look and suggest some solution to tackle this situation.

Regards,
Chetan
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Samuel,

Try out the DispatchActions that come with Struts. They will allow you to handle your Actions without requiring the if/else construct that you mentioned.

As an alternative to Struts' DispatchActions, consider CommandDispatchAction, which copies much of the other DispatchActions' functionality with a bit more flexibility and maintainability.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic