Friday 17 February 2012

ACTIONFORM IS NOT THE MODEL

        Many   developers  get  confused   when  they 
learn  about  the ActionForm  class. Although  it  can
hold  state  for  an  application , the state  that 
it  holds should  be  limited and constructed to  the
user input  that is  received  from  the client, and
the ActionForm  should  hold  it  only until  it  can 
be  validated  and  transferred  to the business tier.
    Business  objects  can  be  persisted  and  should 
contain  the  browser  logic  for  an application. They 
also should  be reusable. This  set  of  criteria does
not  match  up  well when  compared  against  ActionForms
   For  one thing,  the  ActionForm  class  servlet  is 
tied to the struts  framework  and explicitly  to a web
container, as it imports javax.servlet  package.
  It  would be  very  difficult  to  post  ActionForm
classes  to a different  type framework, such as a swing
application.
  ActionForm are designed  exclusively  to capture the
HTML data  from a client, allows presentation, validation
to occur, and provide a transport data from the  tier 
forward to the views. Apart from these users, you should
keep  the ActionForms  separate  from  your  business 
components.




---> These  lines are  from 
"Programming  Jakarta  Struts"