This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Is using ActionForm in Business Tier or Integration Tier good Practice?

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

As per our project architecture, We have Presentation, Business and Integration layers. In presentation layer we are using struts 1.2 and in business layer we are using pure java class which is injected into Action class using Spring DI likewise Integration tier classes are injected into Business Layer.

Here my question is, Using ActionForm object in Business Tier and Integration Tier is Good Practice? If not what is the best way to have detail of form objects in Business and Integration layers.

Thanks,
Antany



 
Bartender
Posts: 9559
12
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Using ActionForm object in Business Tier and Integration Tier is Good Practice?


No it is not. Struts is strictly presentation-tier. You do not want your other tiers dependent on it.

If not what is the best way to have detail of form objects in Business and Integration layers.



I make great use of Apache Commons BeanUtils, which uses reflection to map fields from one bean to another.

If you look at Struts 2 you'll notice it uses plain beans rather than framework-specific classes like ActionForm. This is a huge improvement because one spends less time writing code for the framework and can concentrate on solving business problems.
 
Antany Vasanth
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe Ess,

Thanks a lot!

The information is very much useful.

Regards,
Antany
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!