This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Is using ActionForm in Business Tier or Integration Tier good Practice? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is using ActionForm in Business Tier or Integration Tier good Practice?" Watch "Is using ActionForm in Business Tier or Integration Tier good Practice?" New topic
Author

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

Antany Vasanth
Ranch Hand

Joined: Jan 28, 2009
Posts: 43
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



Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Antany Vasanth
Ranch Hand

Joined: Jan 28, 2009
Posts: 43
Hi Joe Ess,

Thanks a lot!

The information is very much useful.

Regards,
Antany
 
 
subject: Is using ActionForm in Business Tier or Integration Tier good Practice?